aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctOps.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-08 23:30:51 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-08 23:30:51 +0200
commit782a84f7b490baa10afef94dd6954d6ab50d020b (patch)
tree099cf5e07386236924d312606a2e4569658a1fb8 /src/ringct/rctOps.cpp
parentMerge pull request #2845 (diff)
parentadd bulletproofs from v7 on testnet (diff)
downloadmonero-782a84f7b490baa10afef94dd6954d6ab50d020b.tar.xz
Merge pull request #2883
c83d0b3e add bulletproofs from v7 on testnet (moneromooo-monero) 8620ef0a bulletproofs: switch H/G in Pedersen commitments to match rct (moneromooo-monero) d58835b2 integrate bulletproofs into monero (moneromooo-monero) 90b8d9f2 add bulletproofs to the build, with basic unit tests (moneromooo-monero) fe120264 perf_timer: add non scoped start/stop timer defines (moneromooo-monero) ada42914 add a version of ge_double_scalarmult_precomp_vartime with A precomp (moneromooo-monero) d43eef6d ringct: add a version of addKeys which returns the result (moneromooo-monero) 7ff07928 sc_mul and sc_muladd (luigi1111) 3d0b54bd epee: add do while(0) around brace statement in a macro (moneromooo-monero)
Diffstat (limited to 'src/ringct/rctOps.cpp')
-rw-r--r--src/ringct/rctOps.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp
index d0e0964b6..8e94b52b3 100644
--- a/src/ringct/rctOps.cpp
+++ b/src/ringct/rctOps.cpp
@@ -220,6 +220,11 @@ namespace rct {
ge_p3_tobytes(AB.bytes, &A2);
}
+ rct::key addKeys(const key &A, const key &B) {
+ key k;
+ addKeys(k, A, B);
+ return k;
+ }
//addKeys1
//aGB = aG + B where a is a scalar, G is the basepoint, and B is a point
@@ -257,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