class

NaCl::AEAD::Base

Inherits Reference / Object

Constants

ABYTES = LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES
KEYBYTES = LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES
MESSAGEBYTES_MAX = LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_MESSAGEBYTES_MAX
NPUBBYTES = LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES
NSECBYTES = LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES

Constructors

new(key : Indexable(UInt8))
Source

Class methods

key_bytes

The key bytes for the AEAD class

Source
nonce_bytes

The nonce bytes for the AEAD class

Source
tag_bytes

The number bytes in the tag or authenticator from this AEAD class

Source

Instance methods

decrypt(nonce, ciphertext, additional_data = nil)

Decrypts and verifies an encrypted message with additional authenticated data

Source
decrypt_string(nonce, ciphertext, additional_data = nil, encoding = "utf8")

Same as decrypt, but returns a String

Source
do_decrypt(message, message_len, nonce, ciphertext, additional_data)
Source
do_encrypt(ciphertext, ciphertext_len, nonce, message, additional_data)
Source
encrypt(nonce, message, additional_data = nil)

Encrypts and authenticates a message with additional authenticated data

Source
encrypt_string(nonce, message, additional_data = nil)

Same as encrypt, but accepts a String message

Source
key_bytes

The key bytes for the AEAD instance

Source
nonce_bytes

The nonce bytes for the AEAD instance

Source
tag_bytes

The number of bytes in the tag or authenticator for this AEAD instance

Source