blake2_rfc_bellman_edition/
lib.rs

1// Copyright 2015 blake2-rfc Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7
8//! A pure Rust implementation of BLAKE2 based on RFC 7693.
9
10#![no_std]
11
12#![warn(missing_docs)]
13
14#![cfg_attr(feature = "cargo-clippy", warn(clippy_pedantic))]
15#![cfg_attr(feature = "cargo-clippy", allow(missing_docs_in_private_items))]
16
17#![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))]
18#![cfg_attr(feature = "simd_opt", feature(cfg_target_feature))]
19#![cfg_attr(feature = "simd_asm", feature(asm))]
20
21#[cfg(feature = "std")]
22#[macro_use]
23extern crate std;
24
25extern crate arrayvec;
26extern crate byteorder;
27extern crate constant_time_eq;
28
29mod as_bytes;
30mod bytes;
31
32mod simdty;
33mod simdint;
34mod simdop;
35mod simd_opt;
36mod simd;
37
38#[macro_use]
39mod blake2;
40
41pub mod blake2b;
42pub mod blake2s;
43
44/// Runs the self-test for both BLAKE2b and BLAKE2s.
45#[cold]
46pub fn selftest() {
47    blake2b::selftest();
48    blake2s::selftest();
49}
50
51// Internal export of selftest_seq for the benches, not part of the crate API.
52pub use blake2::selftest_seq as _selftest_seq;