Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ jobs:
- nightly
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain 1.75
run: rustup toolchain install 1.75.0-x86_64-unknown-linux-gnu
- name: Install nightly
run: rustup toolchain install nightly-2024-02-01-x86_64-unknown-linux-gnu
- name: Install std source
run: rustup component add rust-src --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu
- name: Install riscv target
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu
- name: Install test dependencies
run: sudo apt-get update && sudo apt-get install -y binutils-riscv64-unknown-elf lld
- name: Run tests
Expand Down
5 changes: 4 additions & 1 deletion algebraic/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ fn from_single_size_limb_witnesses<E: Engine, F: PrimeField>(
) -> F {
assert_eq!(params.num_limbs_for_in_field_representation, witnesses.len());
assert!(
params.binary_limbs_params.limb_size_bits % params.range_check_info.minimal_multiple == 0,
params
.binary_limbs_params
.limb_size_bits
.is_multiple_of(params.range_check_info.minimal_multiple),
"limb size must be divisible by range constraint strategy granularity"
);

Expand Down
4 changes: 2 additions & 2 deletions fields/src/packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ where

fn pack_slice(buf: &[Self::Scalar]) -> &[Self] {
assert!(
buf.len() % Self::WIDTH == 0,
buf.len().is_multiple_of(Self::WIDTH),
"Slice length (got {}) must be a multiple of packed field width ({}).",
buf.len(),
Self::WIDTH
Expand All @@ -81,7 +81,7 @@ where
}
fn pack_slice_mut(buf: &mut [Self::Scalar]) -> &mut [Self] {
assert!(
buf.len() % Self::WIDTH == 0,
buf.len().is_multiple_of(Self::WIDTH),
"Slice length (got {}) must be a multiple of packed field width ({}).",
buf.len(),
Self::WIDTH
Expand Down
2 changes: 1 addition & 1 deletion starky/src/stark_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ pub fn calculate_exps<F: FieldExtension>(
// N-next ~ N: c_last
for i in 0..N {
c_first.eval(ctx, i);
if (i % 10000) == 0 {
if i.is_multiple_of(10000) {
log::trace!("Calculating expression.. {}/{}", i, N);
}
}
Expand Down
14 changes: 7 additions & 7 deletions starky/src/starkinfo_cp_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ fn _calculate_im_pols(
}
(im_e, md)
} else if ["number", "public", "challenge"].contains(&exp.op.as_str()) {
return (im_expressions.clone(), 0);
(im_expressions.clone(), 0)
} else if ["x", "const", "cm"].contains(&exp.op.as_str()) {
if max_deg < 1 {
return (None, -1);
}
return (im_expressions.clone(), 1);
(im_expressions.clone(), 1)
} else if exp.op.as_str() == "mul" {
let mut eb: Option<HashMap<usize, bool>> = None;
let mut ed = -1;
Expand Down Expand Up @@ -192,11 +192,11 @@ fn _calculate_im_pols(
let (e1, d1) =
_calculate_im_pols(pil, &(values[0]), im_expressions, l, abs_max, abs_max_d);
let (e2, d2) = _calculate_im_pols(pil, &(values[1]), &e1, r, abs_max, abs_max_d);
if e2.is_some() {
if let Some(ref e2_) = e2 {
if eb.is_none() {
eb = e2;
ed = d1 + d2;
} else if e2.as_ref().unwrap().len() < eb.as_ref().unwrap().len() {
} else if e2_.len() < eb.as_ref().unwrap().len() {
eb = e2;
ed = d1 + d2;
}
Expand All @@ -208,7 +208,7 @@ fn _calculate_im_pols(
return (eb, ed);
}
}
return (eb, ed);
(eb, ed)
} else if exp.op.as_str() == "exp" {
if max_deg < 1 {
return (None, -1);
Expand All @@ -231,9 +231,9 @@ fn _calculate_im_pols(
if d > *abs_max_d {
*abs_max_d = d;
}
return (Some(e), 1);
(Some(e), 1)
} else {
return (Some(e), d);
(Some(e), d)
}
} else {
panic!("Exp op not defined: {}", exp.op);
Expand Down
Loading