|
@ -24,8 +24,7 @@ use r1cs_std::{ |
|
|
prelude::*,
|
|
|
prelude::*,
|
|
|
};
|
|
|
};
|
|
|
|
|
|
|
|
|
pub trait InjectiveMapGadget<G: Group, I: InjectiveMap<G>, ConstraintF: Field, GG: GroupGadget<G, ConstraintF>>
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
pub trait InjectiveMapGadget<G: Group, I: InjectiveMap<G>, ConstraintF: Field, GG: GroupGadget<G, ConstraintF>> {
|
|
|
type OutputGadget: EqGadget<ConstraintF>
|
|
|
type OutputGadget: EqGadget<ConstraintF>
|
|
|
+ ToBytesGadget<ConstraintF>
|
|
|
+ ToBytesGadget<ConstraintF>
|
|
|
+ CondSelectGadget<ConstraintF>
|
|
|
+ CondSelectGadget<ConstraintF>
|
|
@ -75,13 +74,14 @@ where |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub struct PedersenCRHCompressorGadget<
|
|
|
|
|
|
|
|
|
pub struct PedersenCRHCompressorGadget<G, I, ConstraintF, GG, IG>
|
|
|
|
|
|
where
|
|
|
G: Group,
|
|
|
G: Group,
|
|
|
I: InjectiveMap<G>,
|
|
|
I: InjectiveMap<G>,
|
|
|
ConstraintF: Field,
|
|
|
ConstraintF: Field,
|
|
|
GG: GroupGadget<G, ConstraintF>,
|
|
|
GG: GroupGadget<G, ConstraintF>,
|
|
|
IG: InjectiveMapGadget<G, I, ConstraintF, GG>,
|
|
|
IG: InjectiveMapGadget<G, I, ConstraintF, GG>,
|
|
|
> {
|
|
|
|
|
|
|
|
|
{
|
|
|
_compressor: PhantomData<I>,
|
|
|
_compressor: PhantomData<I>,
|
|
|
_compressor_gadget: PhantomData<IG>,
|
|
|
_compressor_gadget: PhantomData<IG>,
|
|
|
_crh: PedersenCRHGadget<G, ConstraintF, GG>,
|
|
|
_crh: PedersenCRHGadget<G, ConstraintF, GG>,
|
|
|