Skip to main content

DigestExt

Trait DigestExt 

Source
trait DigestExt: Sized {
    // Required methods
    fn chain_varlen(self, bytes: &[u8]) -> Self;
    fn chain_opt(self, bytes: Option<&[u8]>) -> Self;
    fn chain_ct(self, ct: &CiphertextBytes) -> Self;
    fn chain_vk(self, vk: &VerifyingKeyBytes) -> Self;
}
Expand description

Extension methods on sha2::Sha256 used by Inner::sha256 to give the constellation an unambiguous byte encoding before hashing.

Required Methods§

Source

fn chain_varlen(self, bytes: &[u8]) -> Self

Length-prefix (8-byte big-endian, platform-independent) a variable-length field.

Source

fn chain_opt(self, bytes: Option<&[u8]>) -> Self

A 1/0 presence byte, followed by the length-prefixed bytes when present.

Source

fn chain_ct(self, ct: &CiphertextBytes) -> Self

Both length-prefixed ciphertext halves (ML-KEM ‖ EC).

Source

fn chain_vk(self, vk: &VerifyingKeyBytes) -> Self

Both length-prefixed halves (ed25519 ‖ ML-DSA) of a hybrid verifying key.

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 DigestExt for Sha256

Source§

fn chain_varlen(self, bytes: &[u8]) -> Self

Source§

fn chain_opt(self, bytes: Option<&[u8]>) -> Self

Source§

fn chain_ct(self, ct: &CiphertextBytes) -> Self

Source§

fn chain_vk(self, vk: &VerifyingKeyBytes) -> Self

Implementors§