add a version of ge_double_scalarmult_precomp_vartime with A precomp

This commit is contained in:
moneromooo-monero 2017-11-21 22:55:57 +00:00
parent d43eef6def
commit ada4291469
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 19 additions and 3 deletions

View file

@ -262,6 +262,15 @@ namespace rct {
ge_tobytes(aAbB.bytes, &rv);
}
//addKeys3
//aAbB = a*A + b*B where a, b are scalars, A, B are curve points
//A and B must be input after applying "precomp"
void addKeys3(key &aAbB, const key &a, const ge_dsmp A, const key &b, const ge_dsmp B) {
ge_p2 rv;
ge_double_scalarmult_precomp_vartime2(&rv, a.bytes, A, b.bytes, B);
ge_tobytes(aAbB.bytes, &rv);
}
//subtract Keys (subtracts curve points)
//AB = A - B where A, B are curve points

View file

@ -134,6 +134,7 @@ namespace rct {
//aAbB = a*A + b*B where a, b are scalars, A, B are curve points
//B must be input after applying "precomp"
void addKeys3(key &aAbB, const key &a, const key &A, const key &b, const ge_dsmp B);
void addKeys3(key &aAbB, const key &a, const ge_dsmp A, const key &b, const ge_dsmp B);
//AB = A - B where A, B are curve points
void subKeys(key &AB, const key &A, const key &B);
//checks if A, B are equal as curve points