[][src]Function miscreant::siv::s2v

pub fn s2v<M, I, T>(
    mac: &mut M,
    headers: I,
    message: &[u8]
) -> GenericArray<u8, U16> where
    M: Mac<OutputSize = U16>,
    I: IntoIterator<Item = T>,
    T: AsRef<[u8]>, 

"S2V" is a vectorized pseudorandom function (sometimes referred to as a vector MAC or "vMAC") which performs a "dbl"-and-xor operation on the outputs of a pseudo-random function (CMAC or PMAC).

In the RFC 5297 SIV construction (see Section 2.4), message headers (e.g. nonce, associated data) and the plaintext are used as inputs to S2V, together with a message authentication key. The output is the eponymous "synthetic IV" (SIV), which has a dual role as both initialization vector (for AES-CTR encryption) and MAC.