#![doc(html_root_url = "https://docs.rs/scryptenc-wasm/0.1.0/")]
#![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]
pub fn header_size() -> usize {
scryptenc::HEADER_SIZE
}
#[allow(clippy::missing_const_for_fn)]
#[must_use]
#[inline]
#[wasm_bindgen]
pub fn tag_size() -> usize {
scryptenc::TAG_SIZE
}
#[cfg(test)]
mod tests {
use wasm_bindgen_test::wasm_bindgen_test;
#[wasm_bindgen_test]
fn header_size() {
assert_eq!(super::header_size(), 96);
assert_eq!(super::header_size(), scryptenc::HEADER_SIZE);
}
#[wasm_bindgen_test]
fn tag_size() {
assert_eq!(super::tag_size(), 32);
assert_eq!(super::tag_size(), scryptenc::TAG_SIZE);
}
}