mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
Merge pull request #4804
00907c39
rct: speedup commit a little (moneromooo-monero)
This commit is contained in:
commit
cec336ecbc
1 changed files with 3 additions and 6 deletions
|
@ -295,8 +295,7 @@ namespace rct {
|
||||||
|
|
||||||
//generates C =aG + bH from b, a is given..
|
//generates C =aG + bH from b, a is given..
|
||||||
void genC(key & C, const key & a, xmr_amount amount) {
|
void genC(key & C, const key & a, xmr_amount amount) {
|
||||||
key bH = scalarmultH(d2h(amount));
|
addKeys2(C, a, d2h(amount), rct::H);
|
||||||
addKeys1(C, a, bH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//generates a <secret , public> / Pedersen commitment to the amount
|
//generates a <secret , public> / Pedersen commitment to the amount
|
||||||
|
@ -335,10 +334,8 @@ namespace rct {
|
||||||
}
|
}
|
||||||
|
|
||||||
key commit(xmr_amount amount, const key &mask) {
|
key commit(xmr_amount amount, const key &mask) {
|
||||||
key c = scalarmultBase(mask);
|
key c;
|
||||||
key am = d2h(amount);
|
genC(c, mask, amount);
|
||||||
key bH = scalarmultH(am);
|
|
||||||
addKeys(c, c, bH);
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue