Type Definition bearssl::br_poly1305_run [] [src]

type br_poly1305_run = Option<unsafe extern "C" fn(_: *const c_void, _: *const c_void, _: *mut c_void, _: usize, _: *const c_void, _: usize, _: *mut c_void, _: br_chacha20_run, _: c_int)>;

\brief Type for a ChaCha20+Poly1305 AEAD implementation.

The provided data is encrypted or decrypted with ChaCha20. The authentication tag is computed on the concatenation of the additional data and the ciphertext, with the padding and lengths as described in RFC 7539 (section 2.8).

After decryption, the caller is responsible for checking that the computed tag matches the expected value.

\param key secret key (32 bytes). \param iv nonce (12 bytes). \param data data to encrypt or decrypt. \param len data length (in bytes). \param aad additional authenticated data. \param aad_len length of additional authenticated data (in bytes). \param tag output buffer for the authentication tag. \param ichacha implementation of ChaCha20. \param encrypt non-zero for encryption, zero for decryption.