Skip to content

Commit c991342

Browse files
committed
poly1305: rename poly1305_force_soft => poly1305_backend="soft"
Changes the `cfg`-based override to force usage of the soft backend to use `poly1305_backend` following a similar change in `polyval` (#259)
1 parent 9fe701b commit c991342

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

.github/workflows/poly1305.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
# Tests for the portable software backend
109109
soft:
110110
env:
111-
RUSTFLAGS: "-Dwarnings --cfg poly1305_force_soft"
111+
RUSTFLAGS: '-Dwarnings --cfg poly1305_backend="soft"'
112112
runs-on: ubuntu-latest
113113
strategy:
114114
matrix:

poly1305/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ hex-literal = "1"
2424

2525
[lints.rust.unexpected_cfgs]
2626
level = "warn"
27-
check-cfg = ["cfg(fuzzing)", "cfg(poly1305_force_soft)"]
27+
check-cfg = [
28+
'cfg(fuzzing)',
29+
'cfg(poly1305_backend, values("soft"))'
30+
]

poly1305/src/backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
33
#[cfg(all(
44
any(target_arch = "x86", target_arch = "x86_64"),
5-
not(poly1305_force_soft)
5+
not(poly1305_backend = "soft")
66
))]
77
pub(crate) mod avx2;
88

99
#[cfg(all(
1010
any(target_arch = "x86", target_arch = "x86_64"),
11-
not(poly1305_force_soft)
11+
not(poly1305_backend = "soft")
1212
))]
1313
pub(crate) mod autodetect;
1414

poly1305/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ mod backend;
1919

2020
#[cfg(all(
2121
any(target_arch = "x86", target_arch = "x86_64"),
22-
not(poly1305_force_soft),
22+
not(poly1305_backend = "soft"),
2323
target_feature = "avx2", // Fuzz tests bypass AVX2 autodetection code
2424
any(fuzzing, test)
2525
))]
2626
mod fuzz;
2727

2828
#[cfg(all(
2929
any(target_arch = "x86", target_arch = "x86_64"),
30-
not(poly1305_force_soft)
30+
not(poly1305_backend = "soft")
3131
))]
3232
use crate::backend::autodetect::State;
3333

3434
#[cfg(not(all(
3535
any(target_arch = "x86", target_arch = "x86_64"),
36-
not(poly1305_force_soft)
36+
not(poly1305_backend = "soft")
3737
)))]
3838
use crate::backend::soft::State;
3939

@@ -121,7 +121,7 @@ impl Debug for Poly1305 {
121121

122122
#[cfg(all(
123123
any(target_arch = "x86", target_arch = "x86_64"),
124-
not(poly1305_force_soft),
124+
not(poly1305_backend = "soft"),
125125
target_feature = "avx2", // Fuzz tests bypass AVX2 autodetection code
126126
any(fuzzing, test)
127127
))]

0 commit comments

Comments
 (0)