int chacha20poly1305_decrypt(const uint8_t *cipher, size_t cipherlen, uint8_t *msg, size_t *msglen, const uint8_t *aad, size_t aadlen, const uint8_t *key, const uint8_t *nonce)
Verify the tag and decrypt a ciphertext to plaintext.
void chacha20poly1305_encrypt(uint8_t *cipher, const uint8_t *msg, size_t msglen, const uint8_t *aad, size_t aadlen, const uint8_t *key, const uint8_t *nonce)
Encrypt a plaintext to ciphertext and append a tag to protect the ciphertext and additional data.