1#![cfg_attr(not(feature = "std"), no_std)]
18#![forbid(unsafe_code)]
19#![deny(missing_docs)]
20
21#[cfg(feature = "alloc")]
22#[macro_use]
23extern crate alloc;
24
25#[cfg(feature = "alloc")]
26mod alloc_prelude {
27 pub(crate) use alloc::{
28 string::{String, ToString},
29 vec::Vec,
30 };
31}
32
33pub mod error;
35pub use error::{validate, Error, Result};
36
37pub mod block;
39pub use block::{Aes128, Aes192, Aes256, Cbc, Ctr};
40
41pub mod hash;
43pub use hash::{
44 Blake2b, Blake2s, Keccak256, Sha1, Sha224, Sha256, Sha384, Sha3_224, Sha3_256, Sha3_384,
45 Sha3_512, Sha512, Shake128, Shake256,
46};
47
48#[cfg(feature = "alloc")]
50pub mod aead;
51#[cfg(feature = "alloc")]
52pub use aead::{AeadCipher, ChaCha20Poly1305, ChaCha20Poly1305Cipher, Gcm, XChaCha20Poly1305};
53
54pub mod mac;
56pub use mac::{Hmac, Poly1305};
57
58pub mod stream;
60pub use stream::chacha::chacha20::ChaCha20;
61
62#[cfg(feature = "alloc")]
64pub mod kdf;
65#[cfg(feature = "alloc")]
66pub use kdf::{Argon2, Hkdf, KeyDerivationFunction, PasswordHashFunction, Pbkdf2};
67
68pub mod ec;
70pub use ec::{
71 p256,
73 p384,
74 p521,
75 P256Point,
77 P256Scalar,
78 P384Point,
79 P384Scalar,
80 P521Point,
81 P521Scalar,
82};
83
84pub mod types;
86pub use types::{
87 ByteSerializable, ConstantTimeEq, Digest, FixedSize, Nonce, RandomGeneration, Salt,
88 SecretBytes, SecureZeroingType, Tag,
89};
90
91pub use dcrypt_common::security::{
93 barrier, EphemeralSecret, SecretBuffer, SecretVec, SecureCompare, ZeroizeGuard,
94};
95
96pub use types::{
98 algorithms::{
100 Aes128 as Aes128Algorithm, Aes256 as Aes256Algorithm, ChaCha20 as ChaCha20Algorithm,
101 ChaCha20Poly1305 as ChaCha20Poly1305Algorithm, Ed25519 as Ed25519Algorithm,
102 P521 as P521Algorithm, X25519 as X25519Algorithm,
103 },
104
105 digest::{Blake2bCompatible, Keccak256Compatible, Sha256Compatible, Sha512Compatible},
106 key::{AsymmetricPublicKey, AsymmetricSecretKey, SymmetricKey},
108
109 nonce::{AesCtrCompatible, AesGcmCompatible, ChaCha20Compatible, XChaCha20Compatible},
111 salt::{Argon2Compatible, HkdfCompatible, Pbkdf2Compatible},
112 tag::{ChaCha20Poly1305Compatible, GcmCompatible, HmacCompatible, Poly1305Compatible},
113};
114
115#[cfg(feature = "xof")]
117pub mod xof;
118#[cfg(feature = "xof")]
119pub use xof::{Blake3Xof, ExtendableOutputFunction, ShakeXof128, ShakeXof256};
120
121#[cfg(feature = "alloc")] pub mod poly;
124
125#[cfg(feature = "alloc")]
127pub use poly::{
128 ntt::{montgomery_reduce, CooleyTukeyNtt, InverseNttOperator, NttOperator},
129 params::{MlDsaParams, Modulus, NttModulus},
130 polynomial::Polynomial,
131 prelude,
132 sampling::{CbdSampler, DefaultSamplers, UniformSampler},
133 serialize::{CoefficientPacker, CoefficientUnpacker, DefaultCoefficientSerde},
134};