blake2_rfc/
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 = "clippy", feature(plugin))]
15#![cfg_attr(feature = "clippy", plugin(clippy))]
16#![cfg_attr(feature = "clippy", warn(clippy_pedantic))]
17
18#![cfg_attr(all(feature = "bench", test), feature(test))]
19#![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))]
20#![cfg_attr(feature = "simd_opt", feature(cfg_target_feature))]
21#![cfg_attr(feature = "simd_asm", feature(asm))]
22
23#[cfg(any(feature = "std", all(feature = "bench", test)))]
24#[macro_use]
25extern crate std;
26
27#[cfg(all(feature = "bench", test))]
28extern crate test;
29
30extern crate arrayvec;
31extern crate constant_time_eq;
32
33mod as_bytes;
34mod bytes;
35
36mod simdty;
37mod simdint;
38mod simdop;
39mod simd_opt;
40mod simd;
41
42#[macro_use]
43mod blake2;
44
45pub mod blake2b;
46pub mod blake2s;
47
48/// Runs the self-test for both BLAKE2b and BLAKE2s.
49#[cold]
50pub fn selftest() {
51    blake2b::selftest();
52    blake2s::selftest();
53}