mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-22 15:32:24 +00:00
rct: speedup commit a little
saves a conversion, and uses a double scalarmult instead of two scalarmults
This commit is contained in:
parent
7e2483e1d5
commit
00907c3987
1 changed files with 3 additions and 6 deletions
|
@ -117,8 +117,7 @@ namespace rct {
|
|||
|
||||
//generates C =aG + bH from b, a is given..
|
||||
void genC(key & C, const key & a, xmr_amount amount) {
|
||||
key bH = scalarmultH(d2h(amount));
|
||||
addKeys1(C, a, bH);
|
||||
addKeys2(C, a, d2h(amount), rct::H);
|
||||
}
|
||||
|
||||
//generates a <secret , public> / Pedersen commitment to the amount
|
||||
|
@ -149,10 +148,8 @@ namespace rct {
|
|||
}
|
||||
|
||||
key commit(xmr_amount amount, const key &mask) {
|
||||
key c = scalarmultBase(mask);
|
||||
key am = d2h(amount);
|
||||
key bH = scalarmultH(am);
|
||||
addKeys(c, c, bH);
|
||||
key c;
|
||||
genC(c, mask, amount);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue