Skip to content

Commit c295ca0

Browse files
MarkAtwoodclaude
andcommitted
fix(wolfcrypt-wrapper): fix ctx_len type in dilithium verify ctx functions
wc_dilithium_verify_ctx_msg and wc_dilithium_verify_ctx_hash take ctxLen as u8 (matching the 255-byte limit enforced above), but the variables were cast to u32. Fix both to use u8, consistent with all other ctx_len usages in this file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 944b3c0 commit c295ca0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt-wrapper/src/dilithium.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ impl Dilithium {
12361236
return Err(sys::wolfCrypt_ErrorCodes_BUFFER_E);
12371237
}
12381238
let sig_len = sig.len() as u32;
1239-
let ctx_len = ctx.len() as u32;
1239+
let ctx_len = ctx.len() as u8;
12401240
let msg_len = msg.len() as u32;
12411241
let mut res = 0i32;
12421242
let rc = unsafe {
@@ -1282,7 +1282,7 @@ impl Dilithium {
12821282
return Err(sys::wolfCrypt_ErrorCodes_BUFFER_E);
12831283
}
12841284
let sig_len = sig.len() as u32;
1285-
let ctx_len = ctx.len() as u32;
1285+
let ctx_len = ctx.len() as u8;
12861286
let hash_len = hash.len() as u32;
12871287
let mut res = 0i32;
12881288
let rc = unsafe {

0 commit comments

Comments
 (0)