Browse Source

Mark selftest as #[cold]

pull/3/head
Cesar Eduardo Barros 8 years ago
parent
commit
47dfbcc106
  1. 2
      src/blake2.rs
  2. 1
      src/lib.rs

2
src/blake2.rs

@ -297,6 +297,7 @@ macro_rules! blake2_impl {
}
#[cfg_attr(feature = "clippy", allow(cast_possible_truncation))]
#[cold]
pub fn selftest_seq(len: usize) -> Vec<u8> {
use std::num::Wrapping;
@ -318,6 +319,7 @@ pub fn selftest_seq(len: usize) -> Vec<u8> {
macro_rules! blake2_selftest_impl {
($state:ident, $func:ident, $res:expr, $md_len:expr, $in_len:expr) => {
/// Runs the self-test for this hash function.
#[cold]
pub fn selftest() {
use $crate::blake2::selftest_seq;

1
src/lib.rs

@ -39,6 +39,7 @@ pub mod blake2b;
pub mod blake2s;
/// Runs the self-test for both BLAKE2b and BLAKE2s.
#[cold]
pub fn selftest() {
blake2b::selftest();
blake2s::selftest();

Loading…
Cancel
Save