Add rate_bits

This commit is contained in:
wborgeaud 2022-02-16 13:51:10 +01:00
parent c9185d92bb
commit ea9006f52e
2 changed files with 6 additions and 5 deletions

View File

@ -639,6 +639,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
let mut timing = TimingTree::new("preprocess", Level::Trace); let mut timing = TimingTree::new("preprocess", Level::Trace);
let start = Instant::now(); let start = Instant::now();
let rate_bits = self.config.fri_config.rate_bits; let rate_bits = self.config.fri_config.rate_bits;
let cap_height = self.config.fri_config.cap_height;
// Hash the public inputs, and route them to a `PublicInputGate` which will enforce that // Hash the public inputs, and route them to a `PublicInputGate` which will enforce that
// those hash wires match the claimed public inputs. // those hash wires match the claimed public inputs.
@ -664,7 +665,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
let degree_bits = log2_strict(degree); let degree_bits = log2_strict(degree);
let fri_params = self.fri_params(degree_bits); let fri_params = self.fri_params(degree_bits);
assert!( assert!(
fri_params.total_arities() <= degree_bits - self.config.fri_config.cap_height, fri_params.total_arities() <= degree_bits + rate_bits - cap_height,
"FRI total reduction arity is too large.", "FRI total reduction arity is too large.",
); );
@ -705,7 +706,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
constants_sigmas_vecs, constants_sigmas_vecs,
rate_bits, rate_bits,
PlonkOracle::CONSTANTS_SIGMAS.blinding, PlonkOracle::CONSTANTS_SIGMAS.blinding,
self.config.fri_config.cap_height, cap_height,
&mut timing, &mut timing,
Some(&fft_root_table), Some(&fft_root_table),
); );

View File

@ -41,8 +41,10 @@ where
let degree = trace.len(); let degree = trace.len();
let degree_bits = log2_strict(degree); let degree_bits = log2_strict(degree);
let fri_params = config.fri_params(degree_bits); let fri_params = config.fri_params(degree_bits);
let rate_bits = config.fri_config.rate_bits;
let cap_height = config.fri_config.cap_height;
assert!( assert!(
fri_params.total_arities() <= degree_bits - config.fri_config.cap_height, fri_params.total_arities() <= degree_bits + rate_bits - cap_height,
"FRI total reduction arity is too large.", "FRI total reduction arity is too large.",
); );
@ -58,8 +60,6 @@ where
.collect() .collect()
); );
let rate_bits = config.fri_config.rate_bits;
let cap_height = config.fri_config.cap_height;
let trace_commitment = timed!( let trace_commitment = timed!(
timing, timing,
"compute trace commitment", "compute trace commitment",