#![warn(missing_docs)]
#![no_std]
#![cfg_attr(feature="simd", feature(portable_simd))]
#![feature(bigint_helper_methods)]
#![feature(doc_cfg)]
#![feature(test)]
macro_rules! code_name { () => { "zeros" }}
macro_rules! version { () => { "17.3.2" }}
pub const NAME: &str = "Zeros";
pub const CODE_NAME: &str = code_name!();
pub const ID: &str = concat!(
"85ede580-25ef8822-72185cb5-6608f8ae-3c960bc1-75e3ab78-6d1f8a8a-55eb5c40-",
"f0b681d6-13275f82-d587a89e-9de72f64-3951a1b0-79f48b29-de4a6330-817a600f",
);
pub const VERSION: &str = version!();
pub const RELEASE_DATE: (u16, u8, u8) = (2025, 6, 5);
pub const TAG: &str = concat!(code_name!(), "::85ede580::", version!());
#[macro_use]
extern crate alloc;
#[cfg(feature="std")]
extern crate std;
#[cfg(test)]
extern crate test;
macro_rules! e {
() => {
$crate::Error::new(line!(), module_path!(), None)
};
($($s: tt)+) => {
$crate::Error::new(line!(), module_path!(), Some(alloc::borrow::Cow::Borrowed(concat!($($s)+))))
};
}
macro_rules! err {
($($arg: tt)*) => {
$crate::Error::new(line!(), module_path!(), Some(alloc::borrow::Cow::Owned(alloc::format!($($arg)*))))
};
}
#[test]
fn test_macro_err() {
use alloc::borrow::Cow;
macro_rules! s_test { () => { "test" }}
fn eq(first: Error, second: Error) -> bool {
first.line() == second.line() && first.module_path() == second.module_path() && first.msg() == second.msg()
}
assert!(eq(e!(), Error::new(line!(), module_path!(), None)));
assert!(eq(e!(s_test!(), s_test!()), Error::new(line!(), module_path!(), Some(Cow::Borrowed(concat!(s_test!(), s_test!()))))));
assert!(eq(e!("test"), Error::new(line!(), module_path!(), Some(Cow::Borrowed(s_test!())))));
assert!(eq(err!("{s:?}", s=s_test!()), Error::new(line!(), module_path!(), Some(Cow::Owned(alloc::format!("{:?}", s_test!()))))));
let some = "===";
assert_eq!(err!("{some}").msg(), Error::new(line!(), module_path!(), Some(Cow::Borrowed(some))).msg());
}
#[macro_use]
mod error;
mod bytes;
mod str;
mod zeros;
pub mod argon2;
pub mod chacha;
pub mod io;
pub mod keccak;
pub mod poly1305;
pub mod prg;
pub mod version_info;
pub use crate::{
bytes::*,
error::*,
zeros::*,
};
pub type Result<T> = core::result::Result<T, Error>;
#[cfg(feature="std")]
#[doc(cfg(feature="std"))]
pub type IoResult<T> = core::result::Result<T, std::io::Error>;
#[cfg(all(feature="std", test))]
const TEST_LOOPS: usize = 999;
#[test]
fn test_crate_version() {
assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
}