Namespace: Chacha20Poly1305
Methods
(static) decrypt(ciphertext, aad, key, nonce, mac) → {uint32|buffer}
Parameters:
Name |
Type |
Description |
ciphertext |
buffer
|
size len |
aad |
buffer
|
size alen |
key |
buffer
|
size 32 |
nonce |
buffer
|
size 12 |
mac |
buffer
|
size 16 |
- Source:
Returns:
-
-
Type
-
uint32
-
plaintext - size len
-
Type
-
buffer
(static) encrypt(plaintext, aad, key, nonce) → {buffer|buffer}
Parameters:
Name |
Type |
Description |
plaintext |
buffer
|
size len |
aad |
buffer
|
size alen |
key |
buffer
|
size 32 |
nonce |
buffer
|
size 12 |
- Source:
Returns:
-
ciphertext - size len
-
Type
-
buffer
-
mac - size 16
-
Type
-
buffer