Trait halo2_gadgets::sha256::Sha256Instructions
source · pub trait Sha256Instructions<F: Field>: Chip<F> {
type State: Clone + Debug;
type BlockWord: Copy + Debug + Default;
// Required methods
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-sha256-gadget
only.Expand description
The set of circuit instructions required to use the Sha256
gadget.
Required Associated Types§
Required Methods§
sourcefn initialization_vector(
&self,
layouter: &mut impl Layouter<F>
) -> Result<Self::State, Error>
fn initialization_vector( &self, layouter: &mut impl Layouter<F> ) -> Result<Self::State, Error>
Places the SHA-256 IV in the circuit, returning the initial state variable.
sourcefn initialization(
&self,
layouter: &mut impl Layouter<F>,
init_state: &Self::State
) -> Result<Self::State, Error>
fn initialization( &self, layouter: &mut impl Layouter<F>, init_state: &Self::State ) -> Result<Self::State, Error>
Creates an initial state from the output state of a previous block