Skip to content

Commit 96df8f0

Browse files
committed
small fix for const generic used for static_assert_imm2
1 parent 596762d commit 96df8f0

File tree

1 file changed

+2
-2
lines changed
  • crates/core_arch/src/riscv_shared

1 file changed

+2
-2
lines changed

crates/core_arch/src/riscv_shared/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ pub fn sm3p1(x: u32) -> u32 {
684684
///
685685
/// According to RISC-V Cryptography Extensions, Volume I, the execution latency of
686686
/// this instruction must always be independent from the data it operates on.
687-
pub fn sm4ed<const BS: u8>(x: u32, a: u32) -> u32 {
687+
pub fn sm4ed<const BS: i32>(x: u32, a: u32) -> u32 {
688688
static_assert_imm2!(BS); // `bs` immediate value must be within [0, 3]
689689
let ans: u32;
690690
match BS {
@@ -749,7 +749,7 @@ pub fn sm4ed<const BS: u8>(x: u32, a: u32) -> u32 {
749749
///
750750
/// According to RISC-V Cryptography Extensions, Volume I, the execution latency of
751751
/// this instruction must always be independent from the data it operates on.
752-
pub fn sm4ks<const BS: u8>(x: u32, k: u32) -> u32 {
752+
pub fn sm4ks<const BS: i32>(x: u32, k: u32) -> u32 {
753753
static_assert_imm2!(BS); // `bs` immediate value must be within [0, 3]
754754
let ans: u32;
755755
match BS {

0 commit comments

Comments
 (0)