mod aes;
mod argon2;
mod certificate;
mod hash;
mod rand;
mod signature;
use aes::AESError;
pub use aes::{Decrypter, Encrypter, CRYPTER_TAG_SIZE};
pub use argon2::*;
pub use certificate::*;
pub use hash::*;
pub(crate) use rand::*;
pub use signature::*;
use openssl::error::ErrorStack;
use thiserror::Error;
#[derive(Error, Debug)]
#[error(transparent)]
pub struct BasisCryptoError(#[from] BasisCryptoErrorRepr);
#[derive(Error, Debug)]
enum BasisCryptoErrorRepr {
#[error("Error in argon2")]
Argon2(#[from] Argon2Error),
#[error("Error in generating random bytes")]
RandomError { source: ErrorStack },
#[error(transparent)]
HashError(#[from] HashError),
#[error(transparent)]
AESError(#[from] AESError),
#[error(transparent)]
CertificateError(#[from] CertificateError),
#[error(transparent)]
SignatureError(#[from] SignatureError),
#[error("Input too small, since the tag size is 16")]
TooSmallInput,
}