Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Jul 12, 2024
1 parent be0e9ba commit 87cc461
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 26 deletions.
9 changes: 3 additions & 6 deletions yescrypt/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use crate::{
size_t, Binary, DEC,
};

static mut itoa64: &[u8] =
b"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\0";
static mut itoa64: &[u8] = b"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\0";
static mut atoi64_partial: [u8; 77] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 64, 64, 64, 64, 64, 64, 64, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 64, 64, 64, 64, 64,
Expand Down Expand Up @@ -172,8 +171,7 @@ pub(crate) unsafe fn decode64_uint32(
);
chars = chars.wrapping_add(1);
chars;
bits =
(bits as libc::c_uint).wrapping_add(6 as libc::c_int as libc::c_uint);
bits = (bits as libc::c_uint).wrapping_add(6 as libc::c_int as libc::c_uint);
}
*dst = (*dst as libc::c_uint).wrapping_add(c.wrapping_sub(start) << bits);
loop {
Expand All @@ -189,8 +187,7 @@ pub(crate) unsafe fn decode64_uint32(
current_block = 18054886181315620467;
break;
}
bits =
(bits as libc::c_uint).wrapping_sub(6 as libc::c_int as libc::c_uint);
bits = (bits as libc::c_uint).wrapping_sub(6 as libc::c_int as libc::c_uint);
*dst = (*dst as libc::c_uint).wrapping_add(c << bits);
}
match current_block {
Expand Down
4 changes: 2 additions & 2 deletions yescrypt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,8 +1706,8 @@ unsafe fn smix(
if flags & 0x2 as libc::c_int as libc::c_uint != 0 {
if t <= 1 as libc::c_int as libc::c_uint {
if t != 0 {
Nloop_all = (Nloop_all as libc::c_ulong)
.wrapping_mul(2 as libc::c_int as libc::c_ulong);
Nloop_all =
(Nloop_all as libc::c_ulong).wrapping_mul(2 as libc::c_int as libc::c_ulong);
}
Nloop_all = Nloop_all
.wrapping_add(2 as libc::c_int as libc::c_ulong)
Expand Down
27 changes: 9 additions & 18 deletions yescrypt/src/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1627,29 +1627,21 @@ unsafe fn SHA256_Transform(
i += 16 as libc::c_int;
}
let ref mut fresh48 = *state.offset(0 as libc::c_int as isize);
*fresh48 =
(*fresh48 as libc::c_uint).wrapping_add(*S.offset(0 as libc::c_int as isize));
*fresh48 = (*fresh48 as libc::c_uint).wrapping_add(*S.offset(0 as libc::c_int as isize));
let ref mut fresh49 = *state.offset(1 as libc::c_int as isize);
*fresh49 =
(*fresh49 as libc::c_uint).wrapping_add(*S.offset(1 as libc::c_int as isize));
*fresh49 = (*fresh49 as libc::c_uint).wrapping_add(*S.offset(1 as libc::c_int as isize));
let ref mut fresh50 = *state.offset(2 as libc::c_int as isize);
*fresh50 =
(*fresh50 as libc::c_uint).wrapping_add(*S.offset(2 as libc::c_int as isize));
*fresh50 = (*fresh50 as libc::c_uint).wrapping_add(*S.offset(2 as libc::c_int as isize));
let ref mut fresh51 = *state.offset(3 as libc::c_int as isize);
*fresh51 =
(*fresh51 as libc::c_uint).wrapping_add(*S.offset(3 as libc::c_int as isize));
*fresh51 = (*fresh51 as libc::c_uint).wrapping_add(*S.offset(3 as libc::c_int as isize));
let ref mut fresh52 = *state.offset(4 as libc::c_int as isize);
*fresh52 =
(*fresh52 as libc::c_uint).wrapping_add(*S.offset(4 as libc::c_int as isize));
*fresh52 = (*fresh52 as libc::c_uint).wrapping_add(*S.offset(4 as libc::c_int as isize));
let ref mut fresh53 = *state.offset(5 as libc::c_int as isize);
*fresh53 =
(*fresh53 as libc::c_uint).wrapping_add(*S.offset(5 as libc::c_int as isize));
*fresh53 = (*fresh53 as libc::c_uint).wrapping_add(*S.offset(5 as libc::c_int as isize));
let ref mut fresh54 = *state.offset(6 as libc::c_int as isize);
*fresh54 =
(*fresh54 as libc::c_uint).wrapping_add(*S.offset(6 as libc::c_int as isize));
*fresh54 = (*fresh54 as libc::c_uint).wrapping_add(*S.offset(6 as libc::c_int as isize));
let ref mut fresh55 = *state.offset(7 as libc::c_int as isize);
*fresh55 =
(*fresh55 as libc::c_uint).wrapping_add(*S.offset(7 as libc::c_int as isize));
*fresh55 = (*fresh55 as libc::c_uint).wrapping_add(*S.offset(7 as libc::c_int as isize));
}

static mut PAD: [u8; 64] = [
Expand Down Expand Up @@ -1792,8 +1784,7 @@ unsafe fn _SHA256_Update(
return;
}
r = (*ctx).count as usize >> 3 & 0x3f;
(*ctx).count =
((*ctx).count as libc::c_ulong).wrapping_add(len << 3 as libc::c_int);
(*ctx).count = ((*ctx).count as libc::c_ulong).wrapping_add(len << 3 as libc::c_int);
if len < 64usize.wrapping_sub(r) as size_t {
memcpy(
&mut *((*ctx).buf).as_mut_ptr().offset(r as isize) as *mut u8 as *mut libc::c_void,
Expand Down

0 comments on commit 87cc461

Please sign in to comment.