From 18db6234c1d72808ee5a616271622444b7b19b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Mon, 26 Aug 2024 19:30:39 +0300 Subject: [PATCH] relax target feature requirements --- sha2/src/sha256/riscv_zknh.rs | 7 +++++-- sha2/src/sha256/riscv_zknh_compact.rs | 7 +++++-- sha2/src/sha512/riscv_zknh.rs | 7 +++++-- sha2/src/sha512/riscv_zknh_compact.rs | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sha2/src/sha256/riscv_zknh.rs b/sha2/src/sha256/riscv_zknh.rs index bc73faad..5b210f42 100644 --- a/sha2/src/sha256/riscv_zknh.rs +++ b/sha2/src/sha256/riscv_zknh.rs @@ -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 { diff --git a/sha2/src/sha256/riscv_zknh_compact.rs b/sha2/src/sha256/riscv_zknh_compact.rs index cf66ab5c..bfc6157e 100644 --- a/sha2/src/sha256/riscv_zknh_compact.rs +++ b/sha2/src/sha256/riscv_zknh_compact.rs @@ -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 { diff --git a/sha2/src/sha512/riscv_zknh.rs b/sha2/src/sha512/riscv_zknh.rs index 26aa2b59..81e66dad 100644 --- a/sha2/src/sha512/riscv_zknh.rs +++ b/sha2/src/sha512/riscv_zknh.rs @@ -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 { diff --git a/sha2/src/sha512/riscv_zknh_compact.rs b/sha2/src/sha512/riscv_zknh_compact.rs index 6ecb3987..170a5d59 100644 --- a/sha2/src/sha512/riscv_zknh_compact.rs +++ b/sha2/src/sha512/riscv_zknh_compact.rs @@ -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 {