Skip to main content

test_foo_bar_traits/
lib.rs

1#![no_std]
2
3#[cfg(feature = "alloc")]
4extern crate alloc;
5
6// NOTE: This Digest trait and the new `digest` trait APIs overlap to some extent.
7// See issue #1039
8/// A Hash algorithm returning hashes of length `HASH_LEN`.
9pub trait Digest<const HASH_LEN: usize> {
10    /// Writes the digest for the given input byte slice, into `digest` in immediate mode.
11    fn hash(digest: &mut [u8], payload: &[u8]);
12
13    /// Add the `payload` to the digest.
14    fn update(&mut self, payload: &[u8]);
15
16    /// Writes the digest into `digest`.
17    ///
18    /// Note that the digest state can be continued to be used, to extend the
19    /// digest.
20    fn finish(&self, digest: &mut [u8; HASH_LEN]);
21
22    /// Reset the digest state.
23    fn reset(&mut self);
24}
25
26pub mod aead;
27pub mod digest;
28pub mod ecdh;
29pub mod kem;
30
31pub use test_foo_bar_secrets;