Skip to content

Commit

Permalink
Revert "fix(boojum): compute the correct number of PoW seed challenges (
Browse files Browse the repository at this point in the history
#43)"

This reverts commit 8d2f5f7.
  • Loading branch information
robik75 committed Nov 21, 2024
1 parent b4349c4 commit fbfeb2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions crates/boojum/src/cs/implementations/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2111,9 +2111,11 @@ impl<

let now = std::time::Instant::now();

const SEED_BITS: usize = 256;
// pull enough challenges from the transcript
let num_challenges = SEED_BITS.next_multiple_of(F::CHAR_BITS) / F::CHAR_BITS;
let mut num_challenges = 256 / F::CHAR_BITS;
if num_challenges % F::CHAR_BITS != 0 {
num_challenges += 1;
}
let challenges = transcript.get_multiple_challenges(num_challenges);
let pow_challenge = POW::run_from_field_elements(challenges, new_pow_bits, worker);

Expand Down
6 changes: 4 additions & 2 deletions crates/boojum/src/cs/implementations/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,9 +1958,11 @@ impl<F: SmallField, EXT: FieldExtension<2, BaseField = F>> Verifier<F, EXT> {
log!("Doing PoW verification for {} bits", new_pow_bits);
log!("Prover gave challenge 0x{:016x}", proof.pow_challenge);

const SEED_BITS: usize = 256;
// pull enough challenges from the transcript
let num_challenges = SEED_BITS.next_multiple_of(F::CHAR_BITS) / F::CHAR_BITS;
let mut num_challenges = 256 / F::CHAR_BITS;
if num_challenges % F::CHAR_BITS != 0 {
num_challenges += 1;
}
let challenges = transcript.get_multiple_challenges(num_challenges);
let pow_challenge = proof.pow_challenge;

Expand Down
6 changes: 4 additions & 2 deletions crates/boojum/src/gadgets/recursion/recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1493,9 +1493,11 @@ impl<F: SmallField, EXT: FieldExtension<2, BaseField = F>, CS: ConstraintSystem<
log!("Doing PoW verification for {} bits", new_pow_bits);
// log!("Prover gave challenge 0x{:016x}", proof.pow_challenge);

const SEED_BITS: usize = 256;
// pull enough challenges from the transcript
let num_challenges = SEED_BITS.next_multiple_of(F::CHAR_BITS) / F::CHAR_BITS;
let mut num_challenges = 256 / F::CHAR_BITS;
if num_challenges % F::CHAR_BITS != 0 {
num_challenges += 1;
}
let _challenges: Vec<_> = transcript.get_multiple_challenges(cs, num_challenges);

todo!()
Expand Down

0 comments on commit fbfeb2d

Please sign in to comment.