pub mod algorithms;
pub mod digest;
pub mod key;
pub mod nonce;
pub mod salt;
pub mod tag;
pub(crate) mod sealed;
pub use digest::Digest;
pub use key::{AsymmetricPublicKey, AsymmetricSecretKey, SymmetricKey};
pub use nonce::Nonce;
pub use salt::Salt;
pub use tag::Tag;
pub use dcrypt_api::types::{Ciphertext, Key, SecretBytes, SecretVec};
pub use dcrypt_common::security::{
EphemeralSecret,
SecretBuffer,
SecureZeroingType, ZeroizeGuard,
};
pub trait ValidKeySize<A: key::SymmetricAlgorithm, const N: usize>: sealed::Sealed {}
pub trait ValidSecretKeySize<A: key::AsymmetricAlgorithm, const N: usize>: sealed::Sealed {}
pub trait ValidPublicKeySize<A: key::AsymmetricAlgorithm, const N: usize>: sealed::Sealed {}
use rand::{CryptoRng, RngCore};
pub trait ConstantTimeEq {
fn ct_eq(&self, other: &Self) -> bool;
}
pub trait RandomGeneration: Sized {
fn random<R: RngCore + CryptoRng>(rng: &mut R) -> crate::error::Result<Self>;
}
pub trait FixedSize {
fn size() -> usize;
}
pub trait ByteSerializable: Sized {
fn to_bytes(&self) -> Vec<u8>;
fn from_bytes(bytes: &[u8]) -> crate::error::Result<Self>;
}
pub trait AlgorithmCompatible<A> {}
pub use nonce::{AesCtrCompatible, AesGcmCompatible, ChaCha20Compatible, XChaCha20Compatible};
pub use salt::{Argon2Compatible, HkdfCompatible, Pbkdf2Compatible};
pub use digest::{Blake2bCompatible, Keccak256Compatible, Sha256Compatible, Sha512Compatible};
pub use tag::{ChaCha20Poly1305Compatible, GcmCompatible, HmacCompatible, Poly1305Compatible};
#[cfg(feature = "ec")] pub use algorithms::{
Ed25519,
P256,
P384,
P521, X25519,
};
pub use algorithms::{
Aes128,
Aes256,
ChaCha20,
ChaCha20Poly1305,
};
pub use key::{AsymmetricAlgorithm, SymmetricAlgorithm};
pub use algorithms::{
Aes128Key,
Aes256Key,
ChaCha20Key,
ChaCha20Poly1305Key,
Ed25519PublicKey,
Ed25519SecretKey,
P256PublicKeyCompressed,
P256PublicKeyUncompressed,
P256SecretKey,
P384PublicKeyCompressed,
P384PublicKeyUncompressed,
P384SecretKey,
P521PublicKeyCompressed,
P521PublicKeyUncompressed,
P521SecretKey,
X25519PublicKey,
X25519SecretKey,
};