Skip to main content

Module crypto

Module crypto 

Source
Expand description

Core cryptographic algorithms and random number generator.

“Basic” Algorithms:

  • DHKEM-X25519 HPKE
  • SHA256 HKDF
  • ChaCha20Poly1305 AEAD
  • Ed25519 (SHA512) DSA

“Extended” Algorithms:

  • XEdDSA (DSA with X25519)
  • XChaCha20Poly1305 (large IVs)

Random Number Generator:

  • ChaCha20 stream cipher, seeded via getrandom

Modules§

aead
ChaCha20Poly1305 authenticated encryption with additional data (AEAD).
hkdf
Hashed Message Authentication Code (HMAC)-based key derivation function (HKDF) using “hash-mode” with SHA256.
hpke
Hybrid Public Key Encryption (HPKE) with DHKEM-X25519, HKDF SHA256 and ChaCha20Poly1305 AEAD parameters.
sha2
SHA2 hashing functions.
x25519
Elliptic-curve Diffie–Hellman (ECDH) key agreement scheme (X25519).
xchacha20
XChaCha20Poly1305 is a ChaCha20 AEAD variant with an extended 192-bit (24-byte) nonce.
xeddsa
XEdDSA enables use of a single key pair format for both x25519 elliptic curve Diffie-Hellman and Ed25199 signatures.

Structs§

Rng
Cryptographically-secure random number generator that uses the ChaCha algorithm.
Secret
Generic container for sensitive bytes with best-effort security measures.

Enums§

RngError