Skip to content

Commit 76267e1

Browse files
committed
Fix sha2
1 parent 9db411c commit 76267e1

File tree

8 files changed

+14
-4
lines changed

8 files changed

+14
-4
lines changed

sha2/src/sha256/aarch64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! SHA-256 `aarch64` backend.
2+
#![allow(unsafe_op_in_unsafe_fn)]
23

34
// Implementation adapted from mbedtls.
45

sha2/src/sha256/wasm32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::many_single_char_names)]
1+
#![allow(clippy::many_single_char_names, unsafe_op_in_unsafe_fn)]
22
use core::arch::wasm32::*;
33
use core::mem::size_of;
44

sha2/src/sha256/x86_shani.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! SHA-256 `x86`/`x86_64` backend
22
3-
#![allow(clippy::many_single_char_names)]
3+
#![allow(clippy::many_single_char_names, unsafe_op_in_unsafe_fn)]
44

55
#[cfg(target_arch = "x86")]
66
use core::arch::x86::*;

sha2/src/sha512/aarch64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Implementation adapted from mbedtls.
2+
#![allow(unsafe_op_in_unsafe_fn)]
23

34
use core::arch::aarch64::*;
45

sha2/src/sha512/riscv_zknh.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,31 @@ use core::arch::riscv64::*;
1212
compile_error!("riscv-zknh backend requires zknh and zbkb (or zbb) target features");
1313

1414
#[cfg(target_arch = "riscv32")]
15+
#[allow(unsafe_op_in_unsafe_fn)]
1516
unsafe fn sha512sum0(x: u64) -> u64 {
1617
let a = sha512sum0r((x >> 32) as u32, x as u32);
1718
let b = sha512sum0r(x as u32, (x >> 32) as u32);
1819
((a as u64) << 32) | (b as u64)
1920
}
2021

2122
#[cfg(target_arch = "riscv32")]
23+
#[allow(unsafe_op_in_unsafe_fn)]
2224
unsafe fn sha512sum1(x: u64) -> u64 {
2325
let a = sha512sum1r((x >> 32) as u32, x as u32);
2426
let b = sha512sum1r(x as u32, (x >> 32) as u32);
2527
((a as u64) << 32) | (b as u64)
2628
}
2729

2830
#[cfg(target_arch = "riscv32")]
31+
#[allow(unsafe_op_in_unsafe_fn)]
2932
unsafe fn sha512sig0(x: u64) -> u64 {
3033
let a = sha512sig0h((x >> 32) as u32, x as u32);
3134
let b = sha512sig0l(x as u32, (x >> 32) as u32);
3235
((a as u64) << 32) | (b as u64)
3336
}
3437

3538
#[cfg(target_arch = "riscv32")]
39+
#[allow(unsafe_op_in_unsafe_fn)]
3640
unsafe fn sha512sig1(x: u64) -> u64 {
3741
let a = sha512sig1h((x >> 32) as u32, x as u32);
3842
let b = sha512sig1l(x as u32, (x >> 32) as u32);

sha2/src/sha512/riscv_zknh_compact.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,31 @@ use core::arch::riscv64::*;
1212
compile_error!("riscv-zknh-compact backend requires zknh and zbkb (or zbb) target features");
1313

1414
#[cfg(target_arch = "riscv32")]
15+
#[allow(unsafe_op_in_unsafe_fn)]
1516
unsafe fn sha512sum0(x: u64) -> u64 {
1617
let a = sha512sum0r((x >> 32) as u32, x as u32);
1718
let b = sha512sum0r(x as u32, (x >> 32) as u32);
1819
((a as u64) << 32) | (b as u64)
1920
}
2021

2122
#[cfg(target_arch = "riscv32")]
23+
#[allow(unsafe_op_in_unsafe_fn)]
2224
unsafe fn sha512sum1(x: u64) -> u64 {
2325
let a = sha512sum1r((x >> 32) as u32, x as u32);
2426
let b = sha512sum1r(x as u32, (x >> 32) as u32);
2527
((a as u64) << 32) | (b as u64)
2628
}
2729

2830
#[cfg(target_arch = "riscv32")]
31+
#[allow(unsafe_op_in_unsafe_fn)]
2932
unsafe fn sha512sig0(x: u64) -> u64 {
3033
let a = sha512sig0h((x >> 32) as u32, x as u32);
3134
let b = sha512sig0l(x as u32, (x >> 32) as u32);
3235
((a as u64) << 32) | (b as u64)
3336
}
3437

3538
#[cfg(target_arch = "riscv32")]
39+
#[allow(unsafe_op_in_unsafe_fn)]
3640
unsafe fn sha512sig1(x: u64) -> u64 {
3741
let a = sha512sig1h((x >> 32) as u32, x as u32);
3842
let b = sha512sig1l(x as u32, (x >> 32) as u32);

sha2/src/sha512/wasm32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::many_single_char_names)]
1+
#![allow(clippy::many_single_char_names, unsafe_op_in_unsafe_fn)]
22

33
use core::arch::wasm32::*;
44
use core::mem::size_of;

sha2/src/sha512/x86_avx2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! SHA-512 `x86`/`x86_64` backend
22
3-
#![allow(clippy::many_single_char_names)]
3+
#![allow(clippy::many_single_char_names, unsafe_op_in_unsafe_fn)]
44

55
use core::mem::size_of;
66

0 commit comments

Comments
 (0)