Skip to content

Commit

Permalink
static_mut_refs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Jul 12, 2024
1 parent 5089202 commit 762bda6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yescrypt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,13 @@ pub unsafe fn yescrypt_init_shared(
return -(1 as libc::c_int);
}

pub unsafe fn yescrypt_digest_shared(mut shared: *mut Shared) -> *mut Binary {
pub unsafe fn yescrypt_digest_shared(mut shared: *mut Shared) -> Binary {
static mut digest: Binary = Binary { uc: [0; 32] };
let mut tag: *mut uint32_t = 0 as *mut uint32_t;
let mut tag1: uint64_t = 0;
let mut tag2: uint64_t = 0;
if (*shared).aligned_size < 48 as libc::c_int as libc::c_ulong {
return 0 as *mut Binary;
return digest;
}
tag = ((*shared).aligned as *mut uint8_t)
.offset((*shared).aligned_size as isize)
Expand All @@ -619,7 +619,7 @@ pub unsafe fn yescrypt_digest_shared(mut shared: *mut Shared) -> *mut Binary {
if tag1 as libc::c_ulonglong != 0x7470797263736579 as libc::c_ulonglong
|| tag2 as libc::c_ulonglong != 0x687361684d4f522d as libc::c_ulonglong
{
return 0 as *mut Binary;
return digest;
}
le32enc(
(digest.uc).as_mut_ptr() as *mut libc::c_void,
Expand Down Expand Up @@ -654,7 +654,7 @@ pub unsafe fn yescrypt_digest_shared(mut shared: *mut Shared) -> *mut Binary {
*tag.offset(11 as libc::c_int as isize),
);

return &mut digest;
return digest;
}

pub unsafe fn yescrypt_encode_params(
Expand Down

0 comments on commit 762bda6

Please sign in to comment.