@@ -59,6 +59,29 @@ assert_eq!(hash512, hex!(
5959
6060Also, see the [ examples section] in the RustCrypto/hashes readme.
6161
62+ ## Backends
63+
64+ This crate supports the following backends:
65+ - ` soft ` : portable implementation with fully unrolled rounds
66+ - ` soft-compact ` : portable implementation which produces smaller binaries
67+ - ` aarch64-sha2 ` : uses the AArch64 ` sha2 ` extension, fallbacks to the ` soft ` backend
68+ if the extension is not available
69+ - ` loongarch64-asm ` : ` asm! ` -based implementation for LoongArch64 targets
70+ - ` riscv-zknh ` : uses the RISC-V ` Zknh ` scalar crypto extension (experimental)
71+ - ` riscv-zknh-compact ` : same as ` riscv_zknh ` but does not unroll rounds (experimental)
72+ - ` wasm32-simd ` : uses the WASM ` simd128 ` extension
73+ - ` x86-shani ` : uses the x86 SHA-NI extension, fallbacks to the ` soft ` backend
74+ if the extension is not available (SHA-256 only)
75+ - ` x86-avx2 ` : uses the x86 AVX2 extension, fallbacks to the ` soft ` backend
76+ if the extension is not available (SHA-512 only)
77+
78+ You can force backend selection using the ` sha2_backend ` configuration flag. It can be enabled
79+ using either environment variable (e.g. ` RUSTFLAGS='--cfg sha2_backend="soft"' cargo build ` ), or
80+ by modifying your ` .cargo/config.toml ` file. Currently the flag supports the following values:
81+ ` soft ` , ` soft-compact ` , ` riscv-zknh ` , and ` riscv-zknh-compact ` .
82+
83+ Note that the RISC-V backends are experimental and require Nightly compiler.
84+
6285## License
6386
6487The crate is licensed under either of:
0 commit comments