From 793f72308b3fa28763ac2b30c13bd0c56f6b7135 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Mon, 16 Mar 2026 01:05:29 +0000 Subject: [PATCH 1/2] sha2: tweak backend docs --- sha2/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sha2/README.md b/sha2/README.md index e83f8b00..2e71aca3 100644 --- a/sha2/README.md +++ b/sha2/README.md @@ -63,8 +63,10 @@ This crate supports the following backends: - `aarch64-sha2`: uses the AArch64 `sha2` extension, fallbacks to the `soft` backend if the extension is not available - `loongarch64-asm`: `asm!`-based implementation for LoongArch64 targets -- `riscv-zknh`: uses the RISC-V `Zknh` scalar crypto extension (experimental) -- `riscv-zknh-compact`: same as `riscv_zknh` but does not unroll rounds (experimental) +- `riscv-zknh`: uses the RISC-V `Zknh` scalar crypto extension. Experimental, + requires Nightly compiler and to enable `Zknh` and `Zbkb` (or `Zbb`) + target features at compile time. +- `riscv-zknh-compact`: same as `riscv_zknh` but does not unroll rounds. - `wasm32-simd`: uses the WASM `simd128` extension - `x86-shani`: uses the x86 SHA-NI extension, fallbacks to the `soft` backend if the extension is not available (SHA-256 only) @@ -72,11 +74,8 @@ This crate supports the following backends: if the extension is not available (SHA-512 only) You can force backend selection using the `sha2_backend` configuration flag. It can be enabled -using either environment variable (e.g. `RUSTFLAGS='--cfg sha2_backend="soft"' cargo build`), or -by modifying your `.cargo/config.toml` file. Currently the flag supports the following values: -`soft`, `soft-compact`, `riscv-zknh`, and `riscv-zknh-compact`. - -Note that the RISC-V backends are experimental and require Nightly compiler. +using either environment variable (e.g. `RUSTFLAGS='--cfg sha2_backend="soft"'`), +or by modifying your `.cargo/config.toml` file. ## License From 8ee0f81582e075ccdbcc6cd78b483cedcd26c9c8 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Mon, 16 Mar 2026 04:09:53 +0300 Subject: [PATCH 2/2] fix backend name --- sha2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sha2/README.md b/sha2/README.md index 2e71aca3..e0cd4224 100644 --- a/sha2/README.md +++ b/sha2/README.md @@ -66,7 +66,7 @@ This crate supports the following backends: - `riscv-zknh`: uses the RISC-V `Zknh` scalar crypto extension. Experimental, requires Nightly compiler and to enable `Zknh` and `Zbkb` (or `Zbb`) target features at compile time. -- `riscv-zknh-compact`: same as `riscv_zknh` but does not unroll rounds. +- `riscv-zknh-compact`: same as `riscv-zknh` but does not unroll rounds. - `wasm32-simd`: uses the WASM `simd128` extension - `x86-shani`: uses the x86 SHA-NI extension, fallbacks to the `soft` backend if the extension is not available (SHA-256 only)