1#![no_std]
2#![forbid(unsafe_code)]
3#![warn(
4 clippy::unwrap_used,
5 missing_docs,
6 rust_2018_idioms,
7 unused_lifetimes,
8 unused_qualifications
9)]
10#![doc = include_str!("../README.md")]
11
12mod arithmetic;
13mod consts;
14mod impls;
15mod kem;
16mod pke;
17mod sample;
18mod ser;
19
20pub use impls::*;
21
22use turboshake::{
23 CTurboShake256,
24 digest::{ExtendableOutput, Update, XofReader},
25};
26
27pub(crate) fn turboshake256_hash<const DS: u8>(input0: &[u8], input1: &[u8]) -> [u8; 32] {
33 let mut hasher = CTurboShake256::<DS>::default();
34 hasher.update(input0);
35 hasher.update(input1);
36
37 let mut out = [0u8; 32];
38 let mut reader = hasher.finalize_xof();
39 reader.read(&mut out);
40
41 out
42}