class

Swim::Seal

Inherits Reference < Object

AES-256-GCM for one cluster key. The cipher context and the key live for the life of the node. Encrypt and decrypt write into the caller buffer.

Constants

IV = 12
PREFIX = IV + TAG

IV, tag, then ciphertext.

TAG = 16

Constructors

new(secret : String)
Source

Instance methods

decrypt(packet : Bytes, dest : Bytes) : Int32

Writes plaintext into dest. Returns the byte count, or -1 when the tag fails.

Source
encrypt(plain : Bytes, dest : Bytes) : Int32

Writes IV, tag, and ciphertext into dest. Returns the byte count, or -1.

Source