Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/poly1305.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
# Tests for the portable software backend
soft:
env:
RUSTFLAGS: "-Dwarnings --cfg poly1305_force_soft"
RUSTFLAGS: '-Dwarnings --cfg poly1305_backend="soft"'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
5 changes: 4 additions & 1 deletion poly1305/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ hex-literal = "1"

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ["cfg(fuzzing)", "cfg(poly1305_force_soft)"]
check-cfg = [
'cfg(fuzzing)',
'cfg(poly1305_backend, values("soft"))'
]
4 changes: 2 additions & 2 deletions poly1305/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(poly1305_force_soft)
not(poly1305_backend = "soft")
))]
pub(crate) mod avx2;

#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(poly1305_force_soft)
not(poly1305_backend = "soft")
))]
pub(crate) mod autodetect;

Expand Down
8 changes: 4 additions & 4 deletions poly1305/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ mod backend;

#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(poly1305_force_soft),
not(poly1305_backend = "soft"),
target_feature = "avx2", // Fuzz tests bypass AVX2 autodetection code
any(fuzzing, test)
))]
mod fuzz;

#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(poly1305_force_soft)
not(poly1305_backend = "soft")
))]
use crate::backend::autodetect::State;

#[cfg(not(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(poly1305_force_soft)
not(poly1305_backend = "soft")
)))]
use crate::backend::soft::State;

Expand Down Expand Up @@ -121,7 +121,7 @@ impl Debug for Poly1305 {

#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(poly1305_force_soft),
not(poly1305_backend = "soft"),
target_feature = "avx2", // Fuzz tests bypass AVX2 autodetection code
any(fuzzing, test)
))]
Expand Down