API reference / @evolu/common / Crypto

Crypto

Cryptographic utilities

Type-safe cryptographic operations including random number generation, SLIP21 key derivation, XChaCha20-Poly1305 symmetric encryption, PADMÉ padding, and timing-safe comparisons.

Interfaces

InterfaceDescription
RandomBytes-
RandomBytesDep-
SymmetricCryptoSymmetric cryptography.
SymmetricCryptoDecryptError-
SymmetricCryptoDep-
TimingSafeEqualDep-

Type Aliases

Type AliasDescription
EncryptionKey-
Entropy16-
Entropy32-
Entropy64-
TimingSafeEqualPerforms a timing-safe comparison of two Uint8Arrays. Returns true if they are equal, false otherwise. Takes constant time regardless of where the arrays differ.

Variables

VariableDescription
EncryptionKeyThe encryption key for SymmetricCrypto.
Entropy16-
Entropy32-
Entropy64-

Functions

FunctionDescription
createPadmePaddedLengthReturns the PADMÉ padded length for a given input length.
createPadmePaddingCreates a PADMÉ padding array of zeros for the given input length.
createRandomBytes-
createSlip21SLIP21.
createSymmetricCryptoXChaCha20-Poly1305 encryption
deriveSlip21NodeDerives a single node in the SLIP-21 hierarchical key derivation.

Was this page helpful?