diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index dbab6eeec..8eb208a61 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -59,7 +59,7 @@ jobs: run: | cargo make --version || cargo install cargo-make - name: Check code format - run: cargo make fmt + run: cargo make fmt-all-check - name: Run clippy env: diff --git a/README.md b/README.md index c4897cac4..7f3e6b106 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,3 @@ option 1 option 2 - use F_q^2/3 extension field, do not repeat - rule of thumb: n rounds, soundness ~ (64-n) bits - - - - - diff --git a/ff_ext/src/lib.rs b/ff_ext/src/lib.rs index d75b90b28..beb487a69 100644 --- a/ff_ext/src/lib.rs +++ b/ff_ext/src/lib.rs @@ -1,9 +1,9 @@ pub use ff; use ff::FromUniformBytes; use goldilocks::SmallField; +use poseidon::poseidon::Poseidon; use serde::Serialize; use std::ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign}; -use poseidon::poseidon::Poseidon; pub trait ExtensionField: Serialize diff --git a/mpcs/benches/basecode.rs b/mpcs/benches/basecode.rs index a870e1506..91e783e25 100644 --- a/mpcs/benches/basecode.rs +++ b/mpcs/benches/basecode.rs @@ -66,23 +66,23 @@ fn bench_encoding(c: &mut Criterion, is_base: bool) { // Switch to coefficient form let mut coeffs = poly.evaluations.clone(); interpolate_field_type_over_boolean_hypercube(&mut coeffs); - + let mut codeword = <>::EncodingScheme as EncodingScheme>::encode( &pp.encoding_params, &coeffs, ); - + // If using repetition code as basecode, it may be faster to use the following line of code to create the commitment and comment out the two lines above // let mut codeword = evaluate_over_foldable_domain(pp.log_rate, coeffs, &pp.table); - + // The sum-check protocol starts from the first variable, but the FRI part // will eventually produce the evaluation at (alpha_k, ..., alpha_1), so apply // the bit-reversion to reverse the variable indices of the polynomial. // In short: store the poly and codeword in big endian reverse_index_bits_in_place_field_type(&mut coeffs); reverse_index_bits_in_place_field_type(&mut codeword); - + (coeffs, codeword) }) .collect::<(Vec>, Vec>)>(); diff --git a/mpcs/benches/rscode.rs b/mpcs/benches/rscode.rs index 9f2cb9813..927687fea 100644 --- a/mpcs/benches/rscode.rs +++ b/mpcs/benches/rscode.rs @@ -66,23 +66,23 @@ fn bench_encoding(c: &mut Criterion, is_base: bool) { // Switch to coefficient form let mut coeffs = poly.evaluations.clone(); interpolate_field_type_over_boolean_hypercube(&mut coeffs); - + let mut codeword = <>::EncodingScheme as EncodingScheme>::encode( &pp.encoding_params, &coeffs, ); - + // If using repetition code as basecode, it may be faster to use the following line of code to create the commitment and comment out the two lines above // let mut codeword = evaluate_over_foldable_domain(pp.log_rate, coeffs, &pp.table); - + // The sum-check protocol starts from the first variable, but the FRI part // will eventually produce the evaluation at (alpha_k, ..., alpha_1), so apply // the bit-reversion to reverse the variable indices of the polynomial. // In short: store the poly and codeword in big endian reverse_index_bits_in_place_field_type(&mut coeffs); reverse_index_bits_in_place_field_type(&mut codeword); - + (coeffs, codeword) }) .collect::<(Vec>, Vec>)>(); diff --git a/rustfmt.toml b/rustfmt.toml index d37b10e82..9b4246e3a 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,6 +1,7 @@ edition = "2024" version = "Two" -style_edition = "2024" +# TODO(Matthias): enable this once the rustfmt version is updated. +# style_edition = "2024" wrap_comments = false comment_width = 300 imports_granularity = "Crate" diff --git a/transcript/src/basic.rs b/transcript/src/basic.rs index acc2c2319..856abdfea 100644 --- a/transcript/src/basic.rs +++ b/transcript/src/basic.rs @@ -3,7 +3,6 @@ use ff_ext::ExtensionField; use goldilocks::SmallField; use poseidon::poseidon_permutation::PoseidonPermutation; - use crate::Challenge; #[derive(Clone)] @@ -18,9 +17,7 @@ impl Transcript { let label_f = E::BaseField::bytes_to_field_elements(label); perm.set_from_slice(label_f.as_slice(), 0); perm.permute(); - Self { - permutation: perm, - } + Self { permutation: perm } } } @@ -63,7 +60,8 @@ impl Transcript { // Append the challenge to the transcript. pub fn append_challenge(&mut self, challenge: Challenge) { - self.permutation.set_from_slice(challenge.elements.as_bases(), 0); + self.permutation + .set_from_slice(challenge.elements.as_bases(), 0); self.permutation.permute(); }