aboutsummaryrefslogtreecommitdiff
path: root/src/ringct
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-11-21 22:55:57 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-07 19:23:10 +0000
commitada4291469156f76eb605b2110a068df58a4e142 (patch)
tree6400f6cdff24a12d0d30fe0daec53caf92545490 /src/ringct
parentringct: add a version of addKeys which returns the result (diff)
downloadmonero-ada4291469156f76eb605b2110a068df58a4e142.tar.xz
add a version of ge_double_scalarmult_precomp_vartime with A precomp
Diffstat (limited to 'src/ringct')
-rw-r--r--src/ringct/rctOps.cpp9
-rw-r--r--src/ringct/rctOps.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp
index 292bb8f37..8e94b52b3 100644
--- a/src/ringct/rctOps.cpp
+++ b/src/ringct/rctOps.cpp
@@ -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
diff --git a/src/ringct/rctOps.h b/src/ringct/rctOps.h
index 1ff2e257b..3f8f6955c 100644
--- a/src/ringct/rctOps.h
+++ b/src/ringct/rctOps.h
@@ -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