diff options
author | Jack Lloyd <[email protected]> | 2018-06-21 11:25:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-06-21 11:25:05 -0400 |
commit | 49486ffd4a4da10227271d815a8d5b4b11656c54 (patch) | |
tree | 23a63eaedd5844d5c99f40c6bbfa0d5ac0e2a881 /src/lib/pubkey/ec_group | |
parent | 656f08f67b1c69316121d27d446270e8eb8b16f2 (diff) |
Avoid needless alloc and copy
Diffstat (limited to 'src/lib/pubkey/ec_group')
-rw-r--r-- | src/lib/pubkey/ec_group/point_gfp.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/pubkey/ec_group/point_gfp.cpp b/src/lib/pubkey/ec_group/point_gfp.cpp index 5bbef15e7..4c048427f 100644 --- a/src/lib/pubkey/ec_group/point_gfp.cpp +++ b/src/lib/pubkey/ec_group/point_gfp.cpp @@ -95,9 +95,8 @@ void PointGFp::add_affine(const word x_words[], size_t x_size, if(is_zero()) { - // FIXME avoid the copy here - m_coord_x = BigInt(x_words, x_size); - m_coord_y = BigInt(y_words, y_size); + m_coord_x.set_words(x_words, x_size); + m_coord_y.set_words(y_words, y_size); m_coord_z = m_curve.get_1_rep(); return; } @@ -178,10 +177,9 @@ void PointGFp::add(const word x_words[], size_t x_size, if(is_zero()) { - // FIXME avoid the copy here - m_coord_x = BigInt(x_words, x_size); - m_coord_y = BigInt(y_words, y_size); - m_coord_z = BigInt(z_words, z_size); + m_coord_x.set_words(x_words, x_size); + m_coord_y.set_words(y_words, y_size); + m_coord_z.set_words(z_words, z_size); return; } |