#![doc(html_root_url = "https://docs.rs/abcrypt-wasm/0.3.2/")]
#![forbid(unsafe_code)]
#![deny(missing_debug_implementations, missing_docs)]
#![warn(rust_2018_idioms)]
#![warn(clippy::cargo, clippy::nursery, clippy::pedantic)]
mod decrypt;
mod encrypt;
mod params;
use wasm_bindgen::prelude::wasm_bindgen;
pub use crate::{
decrypt::decrypt,
encrypt::{encrypt, encrypt_with_params},
params::Params,
};
#[allow(clippy::missing_const_for_fn)]
#[must_use]
#[inline]
#[wasm_bindgen(js_name = headerSize)]
pub fn header_size() -> usize {
abcrypt::HEADER_SIZE
}
#[allow(clippy::missing_const_for_fn)]
#[must_use]
#[inline]
#[wasm_bindgen(js_name = tagSize)]
pub fn tag_size() -> usize {
abcrypt::TAG_SIZE
}
#[cfg(test)]
mod tests {
use wasm_bindgen_test::wasm_bindgen_test;
#[wasm_bindgen_test]
fn header_size() {
assert_eq!(super::header_size(), 140);
assert_eq!(super::header_size(), abcrypt::HEADER_SIZE);
}
#[wasm_bindgen_test]
fn tag_size() {
assert_eq!(super::tag_size(), 16);
assert_eq!(super::tag_size(), abcrypt::TAG_SIZE);
}
}