abstract class Sodium::Cipher::SecretStream

Direct Known Subclasses

Defined in:

sodium/cipher/secret_stream.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def additional : Bytes? #

Used to authentication but not encrypt additional data.

  • Set this before encrypting and decrypting.
  • This property is set to nil after calling .update.

[View source]
def additional=(additional : Bytes?) #

Used to authentication but not encrypt additional data.

  • Set this before encrypting and decrypting.
  • This property is set to nil after calling .update.

[View source]
abstract def auth_tag_size : Int32 #

[View source]
def decrypt #

[View source]
def encrypt #

[View source]
def final #

Provided for compatibility with block ciphers. Stream ciphers don't have additional data.


[View source]
def header #

Only used for encryption.


[View source]
def header=(buf : Bytes) #

Only used for decryption.


[View source]
abstract def header_size : Int32 #

[View source]
abstract def init_state(header_buf : Bytes) : Nil #

[View source]
def key=(key : Bytes | SecureBuffer) #

[View source]
abstract def key_size : Int32 #

[View source]
def random_key #

Returns a random key in a SecureBuffer.


[View source]
def tag : UInt8 #
  • Set tag before encrypting
  • Tag is set after decrypting

[View source]
def tag=(tag) #
  • Set tag before encrypting
  • Tag is set after decrypting

[View source]
abstract def update(src : Bytes, dst : Bytes) #

[View source]
def update(src : Bytes) : Bytes #

[View source]