abstract class Sodium::Cipher::Aead::Chalsa
- Sodium::Cipher::Aead::Chalsa
- Reference
- Object
Direct Known Subclasses
Defined in:
sodium/cipher/aead/chalsa.crConstructors
-
.new(key : SecureBuffer)
Initializes with a reference to an existing ky.
-
.new(bytes : Bytes, erase = false)
Initializes copying the key to a
SecureBuffer
. -
.new
Initializes with a new random key.
Instance Method Summary
-
#decrypt(src, dst : Bytes? = nil, *, nonce : Nonce, additional = nil) : Bytes
Decrypts
src
and returns plaintext Must supplynonce
Must supplyadditional
if supplied to #encrypt -
#decrypt_detached(src, dst : Bytes? = nil, *, nonce = nil, mac : Bytes? = nil, additional = nil) : Bytes
Decrypts
src
and returns plaintext Must supplymac
andnonce
Must supplyadditional
if supplied to #encrypt - #decrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce, mac : Bytes, additional : String | Bytes | Nil = nil) : Bytes
-
#decrypt_detached_string(src, dst : Bytes? = nil, *, nonce = nil, mac : Bytes? = nil, additional = nil) : String
Decrypts
src
and returns plaintext Must supplymac
andnonce
Must supplyadditional
if supplied to #encrypt -
#decrypt_string(src, dst : Bytes? = nil, *, nonce : Nonce, additional = nil) : String
Decrypts
src
and returns plaintext Must supplynonce
Must supplyadditional
if supplied to #encrypt -
#dup
Returns a shallow copy of this object.
-
#encrypt(src, dst : Bytes? = nil, *, nonce = nil, additional = nil)
Encrypts
src
and returns {ciphertext, nonce} - #encrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce? = nil, mac : Bytes? = nil, additional : String | Bytes | Nil = nil) : Tuple(Bytes, Bytes, Sodium::Nonce)
-
#encrypt_detached(src, dst : Bytes? = nil, *, nonce = nil, mac : Bytes? = nil, additional = nil) : Tuple(Bytes, Bytes, Nonce)
Encrypts
src
and returns {mac, ciphertext, nonce} -
#key : SecureBuffer
Encryption key
Constructor Detail
Instance Method Detail
Decrypts src
and returns plaintext
Must supply nonce
Must supply additional
if supplied to #encrypt
Decrypts src
and returns plaintext
Must supply mac
and nonce
Must supply additional
if supplied to #encrypt
Decrypts src
and returns plaintext
Must supply mac
and nonce
Must supply additional
if supplied to #encrypt
Decrypts src
and returns plaintext
Must supply nonce
Must supply additional
if supplied to #encrypt
Returns a shallow copy of this object.
This allocates a new object and copies the contents of
self
into it.
Encrypts src
and returns {ciphertext, nonce}