Struct arkworks_gadgets::poseidon::CRH
source · [−]pub struct CRH<F: PrimeField>(_);
Implementations
sourceimpl<F: PrimeField> CRH<F>
impl<F: PrimeField> CRH<F>
pub fn permute(
params: &PoseidonParameters<F>,
state: Vec<F>
) -> Result<Vec<F>, PoseidonError>
Trait Implementations
sourceimpl<F: PrimeField> CRH for CRH<F>
impl<F: PrimeField> CRH for CRH<F>
type Output = F
type Parameters = PoseidonParameters<F>
const INPUT_SIZE_BITS: usize
fn setup<R: Rng>(_rng: &mut R) -> Result<Self::Parameters, Error>
fn evaluate(
parameters: &Self::Parameters,
input: &[u8]
) -> Result<Self::Output, Error>
sourceimpl<F: PrimeField> CRHGadget<CRH<F>, F> for CRHGadget<F>
impl<F: PrimeField> CRHGadget<CRH<F>, F> for CRHGadget<F>
type OutputVar = FpVar<F>
type ParametersVar = PoseidonParametersVar<F>
fn evaluate(
parameters: &Self::ParametersVar,
input: &[UInt8<F>]
) -> Result<Self::OutputVar, SynthesisError>
sourceimpl<F: Clone + PrimeField> Clone for CRH<F>
impl<F: Clone + PrimeField> Clone for CRH<F>
sourceimpl<F: Debug + PrimeField> Debug for CRH<F>
impl<F: Debug + PrimeField> Debug for CRH<F>
sourceimpl<F: PrimeField> TwoToOneCRH for CRH<F>
impl<F: PrimeField> TwoToOneCRH for CRH<F>
sourcefn evaluate(
parameters: &Self::Parameters,
left_input: &[u8],
right_input: &[u8]
) -> Result<Self::Output, Error>
fn evaluate(
parameters: &Self::Parameters,
left_input: &[u8],
right_input: &[u8]
) -> Result<Self::Output, Error>
A simple implementation of TwoToOneCRH by asserting left and right input has same length and chain them together.
type Output = F
type Parameters = PoseidonParameters<F>
sourceconst LEFT_INPUT_SIZE_BITS: usize
const LEFT_INPUT_SIZE_BITS: usize
The bit size of the left input.
sourceconst RIGHT_INPUT_SIZE_BITS: usize
const RIGHT_INPUT_SIZE_BITS: usize
The bit size of the right input.
fn setup<R: Rng>(rng: &mut R) -> Result<Self::Parameters, Error>
sourceimpl<F: PrimeField> TwoToOneCRHGadget<CRH<F>, F> for CRHGadget<F>
impl<F: PrimeField> TwoToOneCRHGadget<CRH<F>, F> for CRHGadget<F>
type OutputVar = FpVar<F>
type ParametersVar = PoseidonParametersVar<F>
fn evaluate(
parameters: &Self::ParametersVar,
left_input: &[UInt8<F>],
right_input: &[UInt8<F>]
) -> Result<Self::OutputVar, SynthesisError>
impl<F: Copy + PrimeField> Copy for CRH<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for CRH<F> where
F: RefUnwindSafe,
impl<F> Send for CRH<F>
impl<F> Sync for CRH<F>
impl<F> Unpin for CRH<F> where
F: Unpin,
impl<F> UnwindSafe for CRH<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more