module

RNS::Cryptography

Cryptographic primitives used throughout RNS: hashing (SHA-256/512), HMAC, HKDF key derivation, AES-256-CBC encryption, X25519 ECDH key exchange, Ed25519 signatures, and Fernet-like authenticated encryption.

Constants

HASH_LEN = 32
PROVIDER = :internal

The crypto backend in use. :internal means Crystal OpenSSL bindings.

TRUNCATED_HASHLENGTH = 128

Class methods

full_hash(data : Bytes) : Bytes
Source
hkdf(length : Int32, derive_from : Bytes | Nil, salt : Bytes | Nil = nil, context : Bytes | Nil = nil) : Bytes
Source
sha256(data : Bytes) : Bytes
Source
sha512(data : Bytes) : Bytes
Source
truncated_hash(data : Bytes) : Bytes
Source

Nested types