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