diff options
author | Jack Lloyd <[email protected]> | 2018-03-08 18:00:11 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-08 18:00:11 -0500 |
commit | cc22c1e0a7c53bb4fb92e674c0b2b9ef6fe39c68 (patch) | |
tree | e7beeee4c5742393bc53ee1b30c18eeb170b5817 /src/lib/pubkey | |
parent | b713706554b3b14226f11106d35aa7c564d387e5 (diff) |
Add blinded_base_point_multiply_x
Often useful when the point is not needed
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/ec_group/ec_group.cpp | 7 | ||||
-rw-r--r-- | src/lib/pubkey/ec_group/ec_group.h | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp index 723a4148e..5fb79c923 100644 --- a/src/lib/pubkey/ec_group/ec_group.cpp +++ b/src/lib/pubkey/ec_group/ec_group.cpp @@ -483,6 +483,13 @@ PointGFp EC_Group::blinded_base_point_multiply(const BigInt& k, return data().blinded_base_point_multiply(k, rng, ws); } +BigInt EC_Group::blinded_base_point_multiply_x(const BigInt& k, + RandomNumberGenerator& rng, + std::vector<BigInt>& ws) const + { + return data().blinded_base_point_multiply(k, rng, ws).get_affine_x(); + } + PointGFp EC_Group::blinded_var_point_multiply(const PointGFp& point, const BigInt& k, RandomNumberGenerator& rng, diff --git a/src/lib/pubkey/ec_group/ec_group.h b/src/lib/pubkey/ec_group/ec_group.h index 8238c2902..47652e1b4 100644 --- a/src/lib/pubkey/ec_group/ec_group.h +++ b/src/lib/pubkey/ec_group/ec_group.h @@ -248,6 +248,19 @@ class BOTAN_PUBLIC_API(2,0) EC_Group final /** * Blinded point multiplication, attempts resistance to side channels + * Returns just the x coordinate of the point + * + * @param k the scalar + * @param rng a random number generator + * @param ws a temp workspace + * @return x coordinate of base_point*k + */ + BigInt blinded_base_point_multiply_x(const BigInt& k, + RandomNumberGenerator& rng, + std::vector<BigInt>& ws) const; + + /** + * Blinded point multiplication, attempts resistance to side channels * @param point input point * @param k the scalar * @param rng a random number generator |