Trait Xof

Source
pub trait Xof: Clone {
    type Reader: XofReader;

    // Required methods
    fn new(s: &[u8]) -> Self;
    fn update(&mut self, data: &[u8]);
    fn finalize_xof(self) -> Self::Reader;

    // Provided method
    fn finalize_xof_into(self, out: &mut [u8]) { ... }
}
Expand description

A extendable output function (XOF).

Required Associated Types§

Source

type Reader: XofReader

Reads output bytes.

Required Methods§

Source

fn new(s: &[u8]) -> Self

Creates a new XOF with the customization string s.

Source

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

Updates the running hash with data.

Source

fn finalize_xof(self) -> Self::Reader

Returns the output of the XOF.

Provided Methods§

Source

fn finalize_xof_into(self, out: &mut [u8])

Writes the XOF output to out.

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 Xof for CShake128

Available on crate feature rust-crypto only.
Source§

type Reader = <CoreWrapper<CShake128Core> as ExtendableOutput>::Reader

Source§

fn new(s: &[u8]) -> Self

Source§

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

Source§

fn finalize_xof(self) -> Self::Reader

Source§

impl Xof for CShake256

Available on crate feature rust-crypto only.
Source§

type Reader = <CoreWrapper<CShake256Core> as ExtendableOutput>::Reader

Source§

fn new(s: &[u8]) -> Self

Source§

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

Source§

fn finalize_xof(self) -> Self::Reader

Implementors§