Browse Source

When SIMD is enabled, use the SSE2 code for x86

When enabled, makes BLAKE2b ~20% faster and BLAKE2s ~60% faster on
32-bit x86.
pull/2/head 0.2.5
Cesar Eduardo Barros 9 years ago
parent
commit
19d7bc1232
  1. 2
      Cargo.toml
  2. 15
      src/simd/mod.rs

2
Cargo.toml

@ -1,6 +1,6 @@
[package]
name = "blake2-rfc"
version = "0.2.4"
version = "0.2.5"
authors = ["Cesar Eduardo Barros <cesarb@cesarb.eti.br>"]
description = "A pure Rust implementation of BLAKE2 based on the draft RFC."
repository = "https://github.com/cesarb/blake2-rfc"

15
src/simd/mod.rs

@ -26,17 +26,14 @@
#![allow(non_camel_case_types)]
#[cfg(not(feature = "simd"))]
mod fallback;
#[cfg(not(feature = "simd"))]
pub use self::fallback::*;
#[cfg(all(feature = "simd", target_arch = "x86_64"))]
#[cfg(all(feature = "simd", any(target_arch = "x86", target_arch = "x86_64")))]
mod sse2;
#[cfg(all(feature = "simd", target_arch = "x86_64"))]
#[cfg(all(feature = "simd", any(target_arch = "x86", target_arch = "x86_64")))]
pub use self::sse2::*;
#[cfg(all(feature = "simd", not(any(target_arch = "x86_64"))))]
#[cfg(not(all(feature = "simd", any(target_arch = "x86",
target_arch = "x86_64"))))]
mod fallback;
#[cfg(all(feature = "simd", not(any(target_arch = "x86_64"))))]
#[cfg(not(all(feature = "simd", any(target_arch = "x86",
target_arch = "x86_64"))))]
pub use self::fallback::*;

Loading…
Cancel
Save