Expand description
Type-safe wrappers for cryptographic types
This module provides domain-specific types with compile-time and runtime guarantees for cryptographic operations, designed to be ergonomic while preventing common mistakes.
Re-exports§
pub use digest::Digest;pub use key::AsymmetricPublicKey;pub use key::AsymmetricSecretKey;pub use key::SymmetricKey;pub use nonce::Nonce;pub use salt::Salt;pub use tag::Tag;pub use nonce::AesCtrCompatible;pub use nonce::AesGcmCompatible;pub use nonce::ChaCha20Compatible;pub use nonce::XChaCha20Compatible;pub use salt::Argon2Compatible;pub use salt::HkdfCompatible;pub use salt::Pbkdf2Compatible;pub use digest::Blake2bCompatible;pub use digest::Sha256Compatible;pub use digest::Sha512Compatible;pub use tag::ChaCha20Poly1305Compatible;pub use tag::GcmCompatible;pub use tag::HmacCompatible;pub use tag::Poly1305Compatible;pub use algorithms::Ed25519;pub use algorithms::P256;pub use algorithms::P384;pub use algorithms::P521;pub use algorithms::X25519;pub use algorithms::Aes128;pub use algorithms::Aes256;pub use algorithms::ChaCha20;pub use algorithms::ChaCha20Poly1305;pub use key::AsymmetricAlgorithm;pub use key::SymmetricAlgorithm;pub use algorithms::Aes128Key;pub use algorithms::Aes256Key;pub use algorithms::ChaCha20Key;pub use algorithms::ChaCha20Poly1305Key;pub use algorithms::Ed25519PublicKey;pub use algorithms::Ed25519SecretKey;pub use algorithms::P256PublicKeyCompressed;pub use algorithms::P256PublicKeyUncompressed;pub use algorithms::P256SecretKey;pub use algorithms::P384PublicKeyCompressed;pub use algorithms::P384PublicKeyUncompressed;pub use algorithms::P384SecretKey;pub use algorithms::P521PublicKeyCompressed;pub use algorithms::P521PublicKeyUncompressed;pub use algorithms::P521SecretKey;pub use algorithms::X25519PublicKey;pub use algorithms::X25519SecretKey;
Modules§
- algorithms
- Algorithm definitions for type-safe cryptography
- digest
- Type-safe digest implementation with size guarantees
- key
- Type-safe key implementations with algorithm binding
- nonce
- Type-safe nonce implementation with generic size parameter
- salt
- Type-safe salt implementation with validation
- tag
- Type-safe authentication tag implementation with size guarantees
Structs§
- Ciphertext
- Wrapper for ciphertext data
- Ephemeral
Secret - Ephemeral secret that is automatically zeroized after use
- Key
- Base key type that provides secure memory handling
- Secret
Buffer - Fixed-size secret buffer that guarantees zeroization
- Secret
Bytes - A fixed-size array of bytes that is securely zeroed when dropped
- Secret
Vec - A variable-length vector of bytes that is securely zeroed when dropped
- Zeroize
Guard - Guard type that ensures a value is zeroized when dropped
Traits§
- Algorithm
Compatible - Trait for types compatible with algorithms that have specific size requirements
- Byte
Serializable - Trait for types that can be serialized to a byte representation
- Constant
Time Eq - Trait for cryptographic types with constant-time equality
- Fixed
Size - Trait for types that have a fixed size
- Random
Generation - Trait for cryptographic types that can be randomly generated
- Secure
Zeroing Type - Trait for types that can be securely zeroed and cloned
- Valid
KeySize - Marker trait for validating symmetric key sizes for specific algorithms.
- Valid
Public KeySize - Marker trait for validating asymmetric public key sizes for specific algorithms.
- Valid
Secret KeySize - Marker trait for validating asymmetric secret key sizes for specific algorithms.