Namespace: Chacha20Poly1305

Hacl~Chacha20Poly1305

Methods

(static) aead_decrypt(key, nonce, aad, ciphertext, mac) → {int|buffer}

Parameters:
Name Type Description
key buffer size 32
nonce buffer size 12
aad buffer size alen
ciphertext buffer size len
mac buffer size 16
Source:
Returns:
  • Type
    int
  • plaintext - size len
    Type
    buffer

(static) aead_encrypt(key, nonce, aad, plaintext) → {buffer|buffer}

Parameters:
Name Type Description
key buffer size 32
nonce buffer size 12
aad buffer size alen
plaintext buffer size len
Source:
Returns:
  • ciphertext - size len
    Type
    buffer
  • mac - size 16
    Type
    buffer