Skip to main content

crypto_secretstream_xchacha20poly1305_push

Function crypto_secretstream_xchacha20poly1305_push 

Source
pub fn crypto_secretstream_xchacha20poly1305_push(
    state: &mut State,
    ciphertext: &mut [u8],
    message: &[u8],
    associated_data: Option<&[u8]>,
    tag: u8,
) -> Result<(), Error>
Expand description

Encrypts message from the stream for state, with tag and optional associated_data, placing the result into ciphertext.

Compatible with libsodium’s crypto_secretstream_xchacha20poly1305_push.

NOTE: The libsodium version of this function contains an alignment bug which was left in place, and is reflected in this implementation for compatibility purposes. Refer to commit 290197ba3ee72245fdab5e971c8de43a82b19874

§Errors

Returns an error if message exceeds the maximum supported length or ciphertext is not exactly one authentication tag longer than message.