Crypto
Constants
MUCH_MB = 50
OVERHEAD_SYMMETRIC = MAC.size + Nonce.size
Class methods
blake2b(data : Bytes, *, hash_size : Int32 = 64, key : Bytes | Nil = nil) : Bytes
Calculate BLAKE2b hash of data, result will have hash_size bytes.
hash_size - Length of hash, in bytes. Must be between 1 and 64. Anything below 16 is discouraged when using BLAKE2b as a message authentication code.
Anything below 32 is discouraged when using BLAKE2b as a key derivation function (KDF).
key - Some secret key. When uniformly random, one cannot predict the final hash without it.
decrypt(*, output : Bytes, additional : Bytes | Nil = nil, key : SymmetricKey, input : Bytes) : Bool
Sourceencrypt(*, output : Bytes, key : SymmetricKey, input : Bytes, additional : Bytes | Nil = nil) : Nil
adds nonce and mac to the packet
generate_ed25519_keys
Sourcegenerate_signing_keys
Sourcesha512_hmac(data : Bytes, key : Bytes) : Bytes
Calculate HMAC with SHA-512, that can be used for message authentication codes or as a random oracle.