diff options
Diffstat (limited to 'src/ringct')
-rw-r--r-- | src/ringct/bulletproofs_plus.cc | 6 | ||||
-rw-r--r-- | src/ringct/rctSigs.cpp | 19 |
2 files changed, 6 insertions, 19 deletions
diff --git a/src/ringct/bulletproofs_plus.cc b/src/ringct/bulletproofs_plus.cc index 4472bbd84..77b800064 100644 --- a/src/ringct/bulletproofs_plus.cc +++ b/src/ringct/bulletproofs_plus.cc @@ -644,8 +644,7 @@ try_again: { sc_mul(temp.bytes, temp.bytes, z_squared.bytes); sc_mul(temp2.bytes, y_powers[MN+1].bytes, temp.bytes); - sc_mul(temp2.bytes, temp2.bytes, gamma[j].bytes); - sc_add(alpha1.bytes, alpha1.bytes, temp2.bytes); + sc_muladd(alpha1.bytes, temp2.bytes, gamma[j].bytes, alpha1.bytes); } // These are used in the inner product rounds @@ -706,7 +705,8 @@ try_again: rct::key challenge_squared; sc_mul(challenge_squared.bytes, challenge.bytes, challenge.bytes); - rct::key challenge_squared_inv = invert(challenge_squared); + rct::key challenge_squared_inv; + sc_mul(challenge_squared_inv.bytes, challenge_inv.bytes, challenge_inv.bytes); sc_muladd(alpha1.bytes, dL.bytes, challenge_squared.bytes, alpha1.bytes); sc_muladd(alpha1.bytes, dR.bytes, challenge_squared_inv.bytes, alpha1.bytes); diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index d7883baac..3e85f60ce 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -1235,10 +1235,7 @@ namespace rct { } for (i = 0; i < outamounts.size(); ++i) { - if (plus) - rv.outPk[i].mask = C[i]; - else - rv.outPk[i].mask = rct::scalarmult8(C[i]); + rv.outPk[i].mask = rct::scalarmult8(C[i]); outSk[i].mask = masks[i]; } } @@ -1276,10 +1273,7 @@ namespace rct { } for (i = 0; i < batch_size; ++i) { - if (plus) - rv.outPk[i + amounts_proved].mask = C[i]; - else - rv.outPk[i + amounts_proved].mask = rct::scalarmult8(C[i]); + rv.outPk[i + amounts_proved].mask = rct::scalarmult8(C[i]); outSk[i + amounts_proved].mask = masks[i]; } amounts_proved += batch_size; @@ -1486,10 +1480,7 @@ namespace rct { rct::keyV masks(rv.outPk.size()); for (size_t i = 0; i < rv.outPk.size(); i++) { - if (bulletproof_plus) - masks[i] = rct::scalarmult8(rv.outPk[i].mask); - else - masks[i] = rv.outPk[i].mask; + masks[i] = rv.outPk[i].mask; } key sumOutpks = addKeys(masks); DP(sumOutpks); @@ -1649,8 +1640,6 @@ namespace rct { mask = ecdh_info.mask; key amount = ecdh_info.amount; key C = rv.outPk[i].mask; - if (is_rct_bulletproof_plus(rv.type)) - C = scalarmult8(C); DP("C"); DP(C); key Ctmp; @@ -1682,8 +1671,6 @@ namespace rct { mask = ecdh_info.mask; key amount = ecdh_info.amount; key C = rv.outPk[i].mask; - if (is_rct_bulletproof_plus(rv.type)) - C = scalarmult8(C); DP("C"); DP(C); key Ctmp; |