Skip to content

Commit 2721231

Browse files
committed
Rust wrapper: Remove unnecessary double casts in hmac
1 parent df4a212 commit 2721231

File tree

1 file changed

+2
-2
lines changed
  • wrapper/rust/wolfssl/src/wolfcrypt

1 file changed

+2
-2
lines changed

wrapper/rust/wolfssl/src/wolfcrypt/hmac.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ impl HMAC {
205205
pub fn finalize(&mut self, hash: &mut [u8]) -> Result<(), i32> {
206206
// Check the output buffer size since wc_HmacFinal() does not accept
207207
// a length parameter.
208-
let typ = self.wc_hmac.macType as u32 as i32;
208+
let typ = self.wc_hmac.macType as i32;
209209
let rc = unsafe { ws::wc_HmacSizeByType(typ) };
210210
if rc < 0 {
211211
return Err(rc);
212212
}
213-
let expected_size = rc as u32 as usize;
213+
let expected_size = rc as usize;
214214
if hash.len() != expected_size {
215215
return Err(ws::wolfCrypt_ErrorCodes_BUFFER_E);
216216
}

0 commit comments

Comments
 (0)