Matter::Crypto
Constants
CRYPTO_AUTH_TAG_LENGTH = 16
CRYPTO_EC_CURVE = "prime256v1"
ECDSA P-256 constants (prime256v1)
CRYPTO_EC_KEY_BYTES = 32
CRYPTO_ENCRYPT_ALGORITHM = "aes-128-ccm"
Cryptographic constants for Matter protocol
CRYPTO_HASH_ALGORITHM = "sha256"
CRYPTO_SYMMETRIC_KEY_LENGTH = 16
Log = ::Log.for("matter.crypto")
Class methods
compute_sha256(data : Bytes | Array(Bytes)) : Bytes
Sourcecreate_hkdf_key(secret : Bytes, salt : Bytes, info : Bytes, length : Int32 = 32) : Bytes
Sourcecreate_key_pair
Sourcecreate_pbkdf2_key(secret : Bytes, salt : Bytes, iterations : Int32, key_length : Int32) : Bytes
Sourcedecrypt(key : Bytes, data : Bytes, nonce : Bytes, aad : Bytes | Nil = nil) : Bytes
Sourceencrypt(key : Bytes, data : Bytes, nonce : Bytes, aad : Bytes | Nil = nil) : Bytes
Convenience methods that delegate to the global instance
generate_dh_secret(private_key : Key, peer_public_key : Key) : Bytes
Sourceinstance
Sourceinstance=(crypto : CryptoBase)
Sourceprivate_key(private_key : Bytes | BinaryKeyPair, extractable : Bool = true) : Key
Factory methods for convenience
public_key(public_key : Bytes, extractable : Bool = true) : Key
Sourcerandom_big_int(size : Int32, max_value : BigInt | Nil = nil) : BigInt
Sourcerandom_bytes(length : Int32) : Bytes
Sourcerandom_uint16
Sourcerandom_uint32
Sourcerandom_uint64
Sourcesign_ecdsa(private_key : Key, data : Bytes | Array(Bytes), dsa_encoding : String = "ieee-p1363") : Bytes
Sourcesign_hmac(key : Bytes, data : Bytes) : Bytes
Sourcesymmetric_key(key_bytes : Bytes, extractable : Bool = true) : Key
Sourceverify_ecdsa(public_key : Key, data : Bytes, signature : Bytes, dsa_encoding : String = "ieee-p1363") : Nil
Source