abstract class NaCl::AEAD::Base

Direct Known Subclasses

Defined in:

nacl/aead/base.cr

Constant Summary

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

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(key : Indexable(UInt8)) #

[View source]

Class Method Detail

def self.key_bytes #

The key bytes for the AEAD class


[View source]
def self.nonce_bytes #

The nonce bytes for the AEAD class


[View source]
def self.tag_bytes #

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


[View source]

Instance Method Detail

def decrypt(nonce, ciphertext, additional_data = nil) #

Decrypts and verifies an encrypted message with additional authenticated data


[View source]
def decrypt_string(nonce, ciphertext, additional_data = nil, encoding = "utf8") #

Same as #decrypt, but returns a String


[View source]
abstract def do_decrypt(message, message_len, nonce, ciphertext, additional_data) #

[View source]
abstract def do_encrypt(ciphertext, ciphertext_len, nonce, message, additional_data) #

[View source]
def encrypt(nonce, message, additional_data = nil) #

Encrypts and authenticates a message with additional authenticated data


[View source]
def encrypt_string(nonce, message, additional_data = nil) #

Same as #encrypt, but accepts a String message


[View source]
def key : Indexable(UInt8) #

[View source]
def key_bytes #

The key bytes for the AEAD instance


[View source]
def nonce_bytes #

The nonce bytes for the AEAD instance


[View source]
def tag_bytes #

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


[View source]