Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiplexer chip #23

Merged
merged 3 commits into from
Oct 17, 2023
Merged
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
2 changes: 1 addition & 1 deletion halo2_gadgets/src/ecc/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl EccPoint {
/// Constructs a point from its coordinates, without checking they are on the curve.
///
/// This is an internal API that we only use where we know we have a valid curve point.
pub fn from_coordinates_unchecked(
pub(crate) fn from_coordinates_unchecked(
x: AssignedCell<Assigned<pallas::Base>, pallas::Base>,
y: AssignedCell<Assigned<pallas::Base>, pallas::Base>,
) -> Self {
Expand Down
1 change: 1 addition & 0 deletions halo2_gadgets/src/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
pub mod cond_swap;
pub mod decompose_running_sum;
pub mod lookup_range_check;
pub mod mux;

/// A type that has a value at either keygen or proving time.
pub trait FieldValue<F: Field> {
Expand Down Expand Up @@ -100,7 +101,7 @@
Self {
inner: value.map(|value| bitrange_subset(value, bitrange)),
num_bits,
_phantom: PhantomData::default(),

Check warning on line 104 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:104:34 | 104 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 104 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:104:34 | 104 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
Expand All @@ -115,7 +116,7 @@
Self {
inner: cell,
num_bits,
_phantom: PhantomData::default(),

Check warning on line 119 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:119:34 | 119 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 119 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:119:34 | 119 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}

Expand All @@ -124,7 +125,7 @@
RangeConstrained {
inner: self.inner.value().copied(),
num_bits: self.num_bits,
_phantom: PhantomData::default(),

Check warning on line 128 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:128:34 | 128 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 128 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:128:34 | 128 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
Expand Down Expand Up @@ -404,7 +405,7 @@
assert_eq!(field_elem, sum);
};

decompose(pallas::Base::random(rng), &[0..255]);

Check warning on line 408 in halo2_gadgets/src/utilities.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

an array of `Range` that is only one element

warning: an array of `Range` that is only one element --> halo2_gadgets/src/utilities.rs:408:47 | 408 | decompose(pallas::Base::random(rng), &[0..255]); | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init = note: `-W clippy::single-range-in-vec-init` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::single_range_in_vec_init)]` help: if you wanted a `Vec` that contains the entire range, try | 408 | decompose(pallas::Base::random(rng), &(0..255).collect::<std::vec::Vec<usize>>()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help: if you wanted an array of len 255, try | 408 | decompose(pallas::Base::random(rng), &[0; 255]); | ~~~~~~
decompose(pallas::Base::random(rng), &[0..1, 1..255]);
decompose(pallas::Base::random(rng), &[0..254, 254..255]);
decompose(pallas::Base::random(rng), &[0..127, 127..255]);
Expand Down
Loading
Loading