diff options
author | Shen Noether <Shen.Noether@gmx.com> | 2016-06-02 19:03:35 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:27:59 +0100 |
commit | 56f654996201f5c03f73412ed2d2f0df332a20ab (patch) | |
tree | 2707b8deafe9be9c8207f26b0589c9e9b720ecd2 /src/ringct/rctOps.cpp | |
parent | ringct: changes to hashToPointSimple to calcualte H2 values (diff) | |
download | monero-56f654996201f5c03f73412ed2d2f0df332a20ab.tar.xz |
ringct: cosmetic fixes
Ported from Shen's RingCT repo
Diffstat (limited to 'src/ringct/rctOps.cpp')
-rw-r--r-- | src/ringct/rctOps.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp index 29e5e7e89..cf96da143 100644 --- a/src/ringct/rctOps.cpp +++ b/src/ringct/rctOps.cpp @@ -160,8 +160,8 @@ namespace rct { skpkGen(sk.dest, pk.dest); skpkGen(sk.mask, pk.mask); key am = d2h(amount); - key aH = scalarmultH(am); - addKeys(pk.mask, pk.mask, aH); + key bH = scalarmultH(am); + addKeys(pk.mask, pk.mask, bH); return make_tuple(sk, pk); } @@ -171,13 +171,11 @@ namespace rct { ctkey sk, pk; skpkGen(sk.dest, pk.dest); skpkGen(sk.mask, pk.mask); - //key am = d2h(amount); - //key aH = scalarmultH(am); addKeys(pk.mask, pk.mask, bH); return make_tuple(sk, pk); } - //generates a random uint long long + //generates a random uint long long (for testing) xmr_amount randXmrAmount(xmr_amount upperlimit) { return h2d(skGen()) % (upperlimit); } @@ -678,30 +676,6 @@ void fe_mul(fe h,const fe f,const fe g) -void ge_tobytes2(unsigned char *s,const ge_p2 *h) -{ - fe recip; - fe x; - fe y; - fe_invert(recip,h->Z); - fe_mul(x,h->X,recip); - fe_mul(y,h->Y,recip); - - - fe_tobytes(s,y); -} - - - key hashToPoint2(const key & hh) { - key pointk; - ge_p2 point; - key h = cn_fast_hash(hh); - ge_fromfe_frombytes_vartime(&point, h.bytes); - ge_tobytes2(pointk.bytes, &point); - return pointk; - } - - void hashToPoint(key & pointk, const key & hh) { ge_p2 point; ge_p1p1 point2; |