Skip to main content

Crate bitwarden_crypto_primitives

Crate bitwarden_crypto_primitives 

Source
Expand description

§Bitwarden Crypto Primitives

Single home for the raw cryptographic primitives used by the SDK. Every other crate calls these wrappers instead of a crypto library directly, so the implementing backend can be swapped in one place.

 bitwarden-crypto, importers, vault, ...
                │
                ▼
 bitwarden-crypto-primitives  (stable API: aes_gcm, rsa, ed25519, ...)
                │
                ▼
          backend driver       (RustCrypto)

Prefer the higher level bitwarden-crypto APIs. This crate is hazmat: it does not manage nonces, key lifecycles, or protocol composition.

Modules§

aes_cbc
AES-256-CBC.
aes_gcm
AES-256-GCM.
argon2
Argon2id, version 0x13 (RFC 9106).
ed25519
Ed25519 signatures (RFC 8032).
error 🔒
hash_module 🔒
hkdf
HKDF-SHA256 (RFC 5869).
hmac
HMAC (RFC 2104).
ml_dsa_44
ML-DSA-44 signatures (FIPS 204).
p256
NIST P-256 keys and ECDH.
pbkdf2
PBKDF2 (RFC 8018).
random
Cryptographically secure random number generation from the backend’s CSPRNG.
ristretto255
ristretto255 group operations (RFC 9496), as used by CPace.
rsa
RSA with OAEP padding.
rustcrypto 🔒
RustCrypto backend driver. Each submodule mirrors one public module of the crate.
sha1
SHA-1. Legacy use only (TOTP, HIBP, RSA-OAEP-SHA1).
sha256
SHA-256.
sha384
SHA-384.
sha512
SHA-512.
xaes_256_gcm
XAES-256-GCM (C2SP).
xchacha20_poly1305
XChaCha20-Poly1305.

Enums§

Error
Error returned by every fallible primitive. Carries no secret data.