Correct e_0 to actually be e_0

This commit is contained in:
Luke Parker 2022-07-05 15:14:04 -04:00
parent 2ac5ea651c
commit 0ff5ee8292
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -129,7 +129,7 @@ impl<G0: PrimeGroup, G1: PrimeGroup, const POSSIBLE_VALUES: usize> Bits<G0, G1,
for i in ((actual + 1) .. (actual + POSSIBLE_VALUES + 1)).map(|i| i % POSSIBLE_VALUES) {
let e = Self::nonces(transcript.clone(), R);
e_0 = G0::Scalar::conditional_select(&e_0, &e.0, usize::ct_eq(&i, &1));
e_0 = G0::Scalar::conditional_select(&e_0, &e.0, usize::ct_eq(&i, &0));
// Solve for the real index
if i == actual {
@ -168,7 +168,7 @@ impl<G0: PrimeGroup, G1: PrimeGroup, const POSSIBLE_VALUES: usize> Bits<G0, G1,
let ring = Self::ring(*pow_2, self.commitments);
let e_0 = (self.e_0, scalar_convert(self.e_0).ok_or(DLEqError::InvalidChallenge)?);
let mut e = None;
for i in (1 .. (POSSIBLE_VALUES + 1)).map(|i| i % POSSIBLE_VALUES) {
for i in 0 .. POSSIBLE_VALUES {
e = Some(
Self::R_nonces(transcript.clone(), generators, self.s[i], ring[i], e.unwrap_or(e_0))
);