Sha2Config

Trait Sha2Config 

Source
pub trait Sha2Config: Sha2MainChipConfig + Sha2BlockHasherVmConfig {
    const MESSAGE_LENGTH_BITS: usize;
    const DIGEST_BYTES: usize;

    // Required methods
    fn compress(state: &mut [u8], input: &[u8]);
    fn hash(message: &[u8]) -> Vec<u8> ;
}

Required Associated Constants§

Source

const MESSAGE_LENGTH_BITS: usize

Number of bits used to store the message length (part of the message padding)

Source

const DIGEST_BYTES: usize

Number of bytes in the digest

Required Methods§

Source

fn compress(state: &mut [u8], input: &[u8])

Source

fn hash(message: &[u8]) -> Vec<u8>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Sha2Config for Sha256Config

Source§

const MESSAGE_LENGTH_BITS: usize = 64

Source§

const DIGEST_BYTES: usize = Sha256Config::STATE_BYTES

Source§

fn compress(state: &mut [u8], input: &[u8])

Source§

fn hash(message: &[u8]) -> Vec<u8>

Source§

impl Sha2Config for Sha384Config

Source§

const MESSAGE_LENGTH_BITS: usize = Sha512Config::MESSAGE_LENGTH_BITS

Source§

const DIGEST_BYTES: usize = 48

Source§

fn compress(state: &mut [u8], input: &[u8])

Source§

fn hash(message: &[u8]) -> Vec<u8>

Source§

impl Sha2Config for Sha512Config

Source§

const MESSAGE_LENGTH_BITS: usize = 128

Source§

const DIGEST_BYTES: usize = Sha512Config::STATE_BYTES

Source§

fn compress(state: &mut [u8], input: &[u8])

Source§

fn hash(message: &[u8]) -> Vec<u8>

Implementors§