Skip to content

Commit

Permalink
relax target feature requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Aug 26, 2024
1 parent 8fb3a99 commit 18db623
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
7 changes: 5 additions & 2 deletions sha2/src/sha256/riscv_zknh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ use core::arch::riscv32::*;
#[cfg(target_arch = "riscv64")]
use core::arch::riscv64::*;

#[cfg(not(all(target_feature = "zknh", target_feature = "zbkb")))]
compile_error!("riscv-zknh-compact backend requires enabled zknh and zbkb target features");
#[cfg(not(all(
target_feature = "zknh",
any(target_feature = "zbb", target_feature = "zbkb")
)))]
compile_error!("riscv-zknh backend requires zknh and zbkb (or zbb) target features");

#[inline(always)]
fn ch(x: u32, y: u32, z: u32) -> u32 {
Expand Down
7 changes: 5 additions & 2 deletions sha2/src/sha256/riscv_zknh_compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ use core::arch::riscv32::*;
#[cfg(target_arch = "riscv64")]
use core::arch::riscv64::*;

#[cfg(not(all(target_feature = "zknh", target_feature = "zbkb")))]
compile_error!("riscv-zknh-compact backend requires enabled zknh and zbkb target features");
#[cfg(not(all(
target_feature = "zknh",
any(target_feature = "zbb", target_feature = "zbkb")
)))]
compile_error!("riscv-zknh backend requires zknh and zbkb (or zbb) target features");

#[inline(always)]
fn ch(x: u32, y: u32, z: u32) -> u32 {
Expand Down
7 changes: 5 additions & 2 deletions sha2/src/sha512/riscv_zknh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ use core::arch::riscv32::*;
#[cfg(target_arch = "riscv64")]
use core::arch::riscv64::*;

#[cfg(not(all(target_feature = "zknh", target_feature = "zbkb")))]
compile_error!("riscv-zknh-compact backend requires enabled zknh and zbkb target features");
#[cfg(not(all(
target_feature = "zknh",
any(target_feature = "zbb", target_feature = "zbkb")
)))]
compile_error!("riscv-zknh backend requires zknh and zbkb (or zbb) target features");

#[cfg(target_arch = "riscv32")]
unsafe fn sha512sum0(x: u64) -> u64 {
Expand Down
7 changes: 5 additions & 2 deletions sha2/src/sha512/riscv_zknh_compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ use core::arch::riscv32::*;
#[cfg(target_arch = "riscv64")]
use core::arch::riscv64::*;

#[cfg(not(all(target_feature = "zknh", target_feature = "zbkb")))]
compile_error!("riscv-zknh-compact backend requires enabled zknh and zbkb target features");
#[cfg(not(all(
target_feature = "zknh",
any(target_feature = "zbb", target_feature = "zbkb")
)))]
compile_error!("riscv-zknh-compact backend requires zknh and zbkb (or zbb) target features");

#[cfg(target_arch = "riscv32")]
unsafe fn sha512sum0(x: u64) -> u64 {
Expand Down

0 comments on commit 18db623

Please sign in to comment.