mirror of
https://github.com/serai-dex/serai.git
synced 2025-03-12 09:26:51 +00:00
Replace static Scalar with a uint conversion in BP+
This commit is contained in:
parent
f319966dca
commit
76db682a25
1 changed files with 1 additions and 8 deletions
|
@ -19,13 +19,6 @@ lazy_static! {
|
|||
static ref GENERATORS: Generators = generators_core(b"bulletproof_plus");
|
||||
static ref TRANSCRIPT: [u8; 32] =
|
||||
EdwardsPoint(raw_hash_to_point(hash(b"bulletproof_plus_transcript"))).compress().to_bytes();
|
||||
static ref TWO_SIXTY_FOUR_MINUS_ONE: Scalar = {
|
||||
let mut temp = Scalar::from(2u8);
|
||||
for _ in 0 .. LOG_N {
|
||||
temp *= temp;
|
||||
}
|
||||
temp - Scalar::one()
|
||||
};
|
||||
}
|
||||
|
||||
// TRANSCRIPT isn't a Scalar, so we need this alternative for the first hash
|
||||
|
@ -253,7 +246,7 @@ impl PlusStruct {
|
|||
proof.push((minus_esq, A));
|
||||
proof.push((Scalar(self.d1), G));
|
||||
|
||||
let d_sum = zpow.sum() * *TWO_SIXTY_FOUR_MINUS_ONE;
|
||||
let d_sum = zpow.sum() * Scalar::from(u64::MAX);
|
||||
let y_sum = weighted_powers(y, MN).sum();
|
||||
proof.push((
|
||||
Scalar(self.r1 * y.0 * self.s1) + (esq * ((yMNy * z * d_sum) + ((zsq - z) * y_sum))),
|
||||
|
|
Loading…
Reference in a new issue