Skip to content

Commit d6c8c3c

Browse files
authored
Remove some unsafe (RustCrypto#320)
As far as I can tell, building locally, these functions don't need to be marked `unsafe`.
1 parent a7431da commit d6c8c3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sha2/src/sha512/x86.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,21 @@ unsafe fn rounds_0_63_avx2(
178178
}
179179

180180
#[inline(always)]
181-
unsafe fn rounds_64_79(current_state: &mut State, ms: &MsgSchedule) {
181+
fn rounds_64_79(current_state: &mut State, ms: &MsgSchedule) {
182182
for i in 64..80 {
183183
sha_round(current_state, ms[i & 0xf]);
184184
}
185185
}
186186

187187
#[inline(always)]
188-
unsafe fn process_second_block(current_state: &mut State, t2: &RoundStates) {
188+
fn process_second_block(current_state: &mut State, t2: &RoundStates) {
189189
for t2 in t2.iter() {
190190
sha_round(current_state, *t2);
191191
}
192192
}
193193

194194
#[inline(always)]
195-
unsafe fn sha_round(s: &mut State, x: u64) {
195+
fn sha_round(s: &mut State, x: u64) {
196196
macro_rules! big_sigma0 {
197197
($a:expr) => {
198198
$a.rotate_right(28) ^ $a.rotate_right(34) ^ $a.rotate_right(39)
@@ -242,7 +242,7 @@ unsafe fn sha_round(s: &mut State, x: u64) {
242242
}
243243

244244
#[inline(always)]
245-
unsafe fn accumulate_state(dst: &mut State, src: &State) {
245+
fn accumulate_state(dst: &mut State, src: &State) {
246246
for i in 0..SHA512_HASH_WORDS_NUM {
247247
dst[i] = dst[i].wrapping_add(src[i]);
248248
}

0 commit comments

Comments
 (0)