std1.0.0-beta-7 SafeC docs

std :: crypto::chacha20

Function std::chacha20_poly1305_open

#include <std/crypto/chacha20.h> source ยท definition

int chacha20_poly1305_open(
    []const unsigned char key,
    []const unsigned char nonce,
    []const unsigned char aad,
    []unsigned char data,
    []const unsigned char tag,
)

Checks the tag in constant time and, only if it is authentic, decrypts data[0..len) in place. 1 if authentic, 0 if not (data is then left as the unauthenticated ciphertext).