module

Tinrelay::Crypto

Constants

BOX_PUBLIC_BYTES = 32
BOX_SECRET_BYTES = 32
KDF_PROFILE = "argon2id13-opslimit3-mem64m"
KEY_BYTES = 32
KEYRING_AD = "tinrelay-keyring-v1".to_slice
OWNER_KEY_AD = "tinrelay-owner-key-v1".to_slice
PWHASH_SALT_BYTES = 16
SEAL_OVERHEAD_BYTES = 48
SIGN_PUBLIC_BYTES = 32
SIGN_SECRET_BYTES = 64
SIGN_SEED_BYTES = 32
SIGNATURE_BYTES = 64
XCHACHA_NONCE_BYTES = 24
XCHACHA_TAG_BYTES = 16

Class methods

b64(bytes : Bytes) : String
Source
box_keypair
Source
constant_time_equal?(a : Bytes, b : Bytes) : Bool
Source
decrypt_blob(ciphertext : Bytes, salt : Bytes, nonce : Bytes, passphrase : String, additional : Bytes) : Bytes
Source
decrypt_keyring(ciphertext : Bytes, salt : Bytes, nonce : Bytes, passphrase : String) : Bytes
Source
decrypt_owner_key(ciphertext : Bytes, salt : Bytes, nonce : Bytes, passphrase : String) : Bytes
Source
derive_key(passphrase : String, salt : Bytes) : Bytes
Source
encrypt_blob(plaintext : Bytes, passphrase : String, additional : Bytes) : Tuple(Bytes, Bytes, Bytes)
Source
encrypt_keyring(plaintext : Bytes, passphrase : String) : Tuple(Bytes, Bytes, Bytes)
Source
encrypt_owner_key(plaintext : Bytes, passphrase : String) : Tuple(Bytes, Bytes, Bytes)
Source
fingerprint(public_key : Bytes) : String
Source
init
Source
memzero(bytes : Bytes) : Nil
Source
open(ciphertext : Bytes, public_key : Bytes, secret_key : Bytes) : Bytes
Source
random(size : Int32) : Bytes
Source
seal(message : Bytes, public_key : Bytes) : Bytes
Source
sign(message : Bytes, secret_key : Bytes) : Bytes
Source
signing_keypair(seed : Bytes) : SigningKeyPair
Source
signing_keypair
Source
unb64(value : String, label : String = "base64 value") : Bytes
Source
verify(message : Bytes, signature : Bytes, public_key : Bytes) : Bool
Source

Nested types