class Sodium::Cipher::SecretStream::XChaCha20Poly1305
Overview
This class mimicks the OpenSSL::Cipher interface with minor differences.
- every .update is it's own authenticated message. Unlike OpenSSL this class doesn't buffer data. You must handle the framing yourself.
- .header must be called for encryption before calling .update
- .header= must be called for decryption with the data returned from .header before calling .update
- A tag may be set before encrypting and is set after calling .update when decrypting.
- .additional may be set before encrypting and must be set before decrypting.
See spec/sodium/cipher/secret_stream_spec.cr
for examples on how to use this class.
WARNING: Not verified against test vectors.
Defined in:
sodium/cipher/secret_stream.crInstance Method Summary
- #auth_tag_size : Int32
- #header_size : Int32
- #key_size : Int32
- #tag_final
- #tag_push
- #tag_rekey
- #update(src : Bytes, dst : Bytes) : Bytes
Instance methods inherited from class Sodium::Cipher::SecretStream
additional : Bytes?
additional,
additional=(additional : Bytes?)
additional=,
auth_tag_size : Int32
auth_tag_size,
decrypt
decrypt,
encrypt
encrypt,
final
final,
header
header,
header=(buf : Bytes)
header=,
header_size : Int32
header_size,
init_state(header_buf : Bytes) : Nil
init_state,
key=(key : Bytes | SecureBuffer)
key=,
key_size : Int32
key_size,
random_key
random_key,
tag : UInt8
tag,
tag=(tag)
tag=,
update(src : Bytes, dst : Bytes)update(src : Bytes) : Bytes update