mbedtls_poly1305_mac() function
This function calculates the Poly1305 MAC of the input buffer with the provided key. \warning The key must be unique and unpredictable for each invocation of Poly1305.
Syntax
int mbedtls_poly1305_mac(const unsigned char key[32],
const unsigned char *input,
size_t ilen,
unsigned char mac[16]);
Arguments
key
The buffer containing the \c 32 Byte (\c 256 Bit) key.
input
The buffer holding the input data. This pointer can be \c NULL if `ilen == 0`.
ilen
The length of the input data in Bytes. Any value is accepted.
mac
The buffer to where the MAC is written. This must be a writable buffer of length \c 16 Bytes.
Return value
\c 0 on success. A negative error code on failure.
![]()
int mbedtls_poly1305_mac(const unsigned char key[32],