Skip to content

Commit db6ded4

Browse files
committed
AVX2 detection debugging
1 parent 976c4f5 commit db6ded4

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

poly1305/src/autodetect.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@ union Inner {
1818
impl State {
1919
/// Initialize Poly1305 [`State`] with the given key
2020
#[inline]
21-
pub(crate) fn new(key: &Key) -> State {
22-
let (token, avx2_present) = avx2_cpuid::init_get();
21+
pub(crate) fn new(_key: &Key) -> State {
22+
let (_, avx2_present) = avx2_cpuid::init_get();
2323

24-
let inner = if avx2_present {
25-
Inner {
26-
avx2: backend::avx2::State::new(key),
27-
}
24+
if avx2_present {
25+
//Inner {
26+
// avx2: backend::avx2::State::new(key),
27+
//}
28+
panic!("AVX2 detected!");
2829
} else {
29-
Inner {
30-
soft: backend::soft::State::new(key),
31-
}
30+
//Inner {
31+
// soft: backend::soft::State::new(key),
32+
//}
33+
panic!("AVX2 NOT detected!")
3234
};
3335

34-
Self { inner, token }
36+
//Self { inner, token }
3537
}
3638

3739
/// Reset internal state

poly1305/src/backend/avx2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! AVX2 implementation of the Poly1305 state machine.
22
3+
#![allow(dead_code)]
4+
35
// The State struct and its logic was originally derived from Goll and Gueron's AVX2 C
46
// code:
57
// [Vectorization of Poly1305 message authentication code](https://ieeexplore.ieee.org/document/7113463)

poly1305/src/backend/avx2/helpers.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! AVX2 helpers for implementing Poly1305 using 26-bit limbs.
22
3+
#![allow(dead_code)]
4+
35
use core::fmt;
46
use core::ops::{Add, Mul};
57

poly1305/src/backend/soft.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// ...and was originally a port of Andrew Moons poly1305-donna
1313
// https://github.com/floodyberry/poly1305-donna
1414

15+
#![allow(dead_code)]
16+
1517
use core::convert::TryInto;
1618

1719
#[cfg(feature = "zeroize")]

0 commit comments

Comments
 (0)