Trait halo2_gadgets::sha256::Sha256Instructions
source · [−]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>;
}
Expand description
The set of circuit instructions required to use the Sha256
gadget.
Required Associated Types
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.