pub trait Sha256Instructions<F: FieldExt>: Chip<F> {
    type State: Clone + Debug;
    type BlockWord: Copy + Debug + Default;

    fn initialization_vector(
        &self,
        layouter: &mut impl Layouter<F>
    ) -> Result<Self::State, Error>; fn initialization(
        &self,
        layouter: &mut impl Layouter<F>,
        init_state: &Self::State
    ) -> Result<Self::State, Error>; fn compress(
        &self,
        layouter: &mut impl Layouter<F>,
        initialized_state: &Self::State,
        input: [Self::BlockWord; 16]
    ) -> Result<Self::State, Error>; fn digest(
        &self,
        layouter: &mut impl Layouter<F>,
        state: &Self::State
    ) -> Result<[Self::BlockWord; 8], Error>; }
Available on crate feature unstable only.
Expand description

The set of circuit instructions required to use the Sha256 gadget.

Required Associated Types

Variable representing the SHA-256 internal state.

Variable representing a 32-bit word of the input block to the SHA-256 compression function.

Required Methods

Places the SHA-256 IV in the circuit, returning the initial state variable.

Creates an initial state from the output state of a previous block

Starting from the given initialized state, processes a block of input and returns the final state.

Converts the given state into a message digest.

Implementors