Skip to content

Commit

Permalink
Merge pull request privacy-scaling-explorations#137 from input-output…
Browse files Browse the repository at this point in the history
…-hk/dev-feature/recursive-chip

Implement chip for recursive proof verification
  • Loading branch information
b13decker authored Mar 7, 2024
2 parents 9575960 + 8f1a73c commit b2752df
Show file tree
Hide file tree
Showing 8 changed files with 618 additions and 31 deletions.
12 changes: 6 additions & 6 deletions halo2_gadgets/src/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod utilities;

/// The set of circuit instructions required to use the ECC gadgets.
pub trait EccInstructions<C: CurveAffine>:
Chip<C::Base> + UtilitiesInstructions<C::Base> + Clone + Debug + Eq
Chip<C::Base> + UtilitiesInstructions<C::Base> + Debug
{
/// Variable representing a scalar used in variable-base scalar
/// mul. Internally both scalar-field scalars and base-field
Expand Down Expand Up @@ -295,7 +295,7 @@ pub struct NonIdentityPoint<C: CurveAffine, EccChip: EccInstructions<C>> {
inner: EccChip::NonIdentityPoint,
}

impl<C: CurveAffine, EccChip: EccInstructions<C>> NonIdentityPoint<C, EccChip> {
impl<C: CurveAffine, EccChip: EccInstructions<C> + Eq + Clone> NonIdentityPoint<C, EccChip> {
/// Constructs a new point with the given value.
pub fn new(
chip: EccChip,
Expand Down Expand Up @@ -524,12 +524,12 @@ pub struct FixedPointBaseField<C: CurveAffine, EccChip: EccInstructions<C>> {

/// Precomputed multiples of a fixed point, for short signed scalar multiplication.
#[derive(Clone, Debug)]
pub struct FixedPointShort<C: CurveAffine, EccChip: EccInstructions<C>> {
pub struct FixedPointShort<C: CurveAffine, EccChip: EccInstructions<C> + Eq> {
chip: EccChip,
inner: <EccChip::FixedPoints as FixedPoints<C>>::ShortScalar,
}

impl<C: CurveAffine, EccChip: EccInstructions<C>> FixedPoint<C, EccChip> {
impl<C: CurveAffine, EccChip: EccInstructions<C> + Eq + Clone> FixedPoint<C, EccChip> {
#[allow(clippy::type_complexity)]
/// Returns `[by] self`.
pub fn mul(
Expand Down Expand Up @@ -563,7 +563,7 @@ impl<C: CurveAffine, EccChip: EccInstructions<C>> FixedPoint<C, EccChip> {
}
}

impl<C: CurveAffine, EccChip: EccInstructions<C>> FixedPointBaseField<C, EccChip> {
impl<C: CurveAffine, EccChip: EccInstructions<C> + Eq + Clone> FixedPointBaseField<C, EccChip> {
#[allow(clippy::type_complexity)]
/// Returns `[by] self`.
pub fn mul(
Expand All @@ -588,7 +588,7 @@ impl<C: CurveAffine, EccChip: EccInstructions<C>> FixedPointBaseField<C, EccChip
}
}

impl<C: CurveAffine, EccChip: EccInstructions<C>> FixedPointShort<C, EccChip> {
impl<C: CurveAffine, EccChip: EccInstructions<C> + Eq + Clone> FixedPointShort<C, EccChip> {
#[allow(clippy::type_complexity)]
/// Returns `[by] self`.
pub fn mul(
Expand Down
2 changes: 2 additions & 0 deletions halo2_gadgets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
pub mod ecc;
pub mod endoscale;
pub mod poseidon;
pub mod recursive_chip;
pub mod recursive_circuits;
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub mod sha256;
Expand Down
Loading

0 comments on commit b2752df

Please sign in to comment.