embassy-boot

Crates

git

Versions

default

Flavors

Skip to main content

Digest

Trait Digest 

Source
pub trait Digest: Sealed {
    type Output: AsRef<[u8]>;

    const OUTPUT_SIZE: usize;

    // Required methods
    fn new() -> Self;
    fn update(&mut self, data: &[u8]);
    fn finalize(self) -> Self::Output;
}
Expand description

Wrapper trait for emassy-crypto hashers

Required Associated Constants§

Source

const OUTPUT_SIZE: usize

The output size of the hasher (in bytes)

Required Associated Types§

Source

type Output: AsRef<[u8]>

The output type of the hasher

Required Methods§

Source

fn new() -> Self

Create a new hasher instance

Source

fn update(&mut self, data: &[u8])

Process data, updating the internal state

Source

fn finalize(self) -> Self::Output

Retrieve result and consume hasher instance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Digest for Sha1

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha1::OUTPUT_SIZE

Source§

type Output = [u8; 20]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 20]

Source§

impl Digest for Sha224

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha224::OUTPUT_SIZE

Source§

type Output = [u8; 28]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 28]

Source§

impl Digest for Sha256

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha256::OUTPUT_SIZE

Source§

type Output = [u8; 32]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 32]

Source§

impl Digest for Sha384

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha384::OUTPUT_SIZE

Source§

type Output = [u8; 48]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 48]

Source§

impl Digest for Sha512

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha512::OUTPUT_SIZE

Source§

type Output = [u8; 64]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 64]

Source§

impl Digest for Sha512_224

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha512_224::OUTPUT_SIZE

Source§

type Output = [u8; 28]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 28]

Source§

impl Digest for Sha512_256

Source§

const OUTPUT_SIZE: usize = embassy_crypto::Sha512_256::OUTPUT_SIZE

Source§

type Output = [u8; 32]

Source§

fn new() -> Self

Source§

fn update(&mut self, d: &[u8])

Source§

fn finalize(self) -> [u8; 32]

Implementors§