From 55538b5ed1ecf8169734d10dd9f6bf7ffb1479b0 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: Wed, 21 Aug 2024 17:54:40 +0300 Subject: [PATCH] Add compilation error for zknh on non-RISC-V targets --- sha2/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sha2/src/lib.rs b/sha2/src/lib.rs index 0c757e42..1efc78b6 100644 --- a/sha2/src/lib.rs +++ b/sha2/src/lib.rs @@ -11,6 +11,12 @@ feature(riscv_ext_intrinsics) )] +#[cfg(all( + any(sha2_backend = "riscv-zknh", sha2_backend = "riscv-zknh-compact"), + not(any(any(target_arch = "riscv32", target_arch = "riscv64"))) +))] +compile_error!("The Zknh backends can be enabled only for RISC-V targets"); + pub use digest::{self, Digest}; #[cfg(feature = "oid")]