rust_ev_crypto_primitives/basic_crypto_functions/
mod.rs1mod aes;
20mod argon2;
21mod certificate;
22mod hash;
23mod rand;
24mod signature;
25
26use aes::AESError;
27pub use aes::{Decrypter, Encrypter, CRYPTER_TAG_SIZE};
28pub use argon2::*;
29pub use certificate::*;
30pub use hash::*;
31pub(crate) use rand::*;
32pub use signature::*;
33
34use openssl::error::ErrorStack;
35use thiserror::Error;
36
37#[derive(Error, Debug)]
38#[error(transparent)]
39pub struct BasisCryptoError(#[from] BasisCryptoErrorRepr);
41
42#[derive(Error, Debug)]
44enum BasisCryptoErrorRepr {
45 #[error("Error in argon2")]
46 Argon2(#[from] Argon2Error),
47 #[error("Error in generating random bytes")]
48 RandomError { source: ErrorStack },
49 #[error(transparent)]
50 HashError(#[from] HashError),
51 #[error(transparent)]
52 AESError(#[from] AESError),
53 #[error(transparent)]
54 CertificateError(#[from] CertificateError),
55 #[error(transparent)]
56 SignatureError(#[from] SignatureError),
57 #[error("Input too small, since the tag size is 16")]
58 TooSmallInput,
59}