Skip to content

fixing 32bit truncation for HKDF and sp800 - #101

Merged
Khang (nnmkhang) merged 1 commit into
release/0.6.0from
user/khangnguyen/fix-output-key-size-type
May 22, 2026
Merged

fixing 32bit truncation for HKDF and sp800#101
Khang (nnmkhang) merged 1 commit into
release/0.6.0from
user/khangnguyen/fix-output-key-size-type

Conversation

@nnmkhang

@nnmkhang Khang (nnmkhang) commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description of Changes:

Changed sp800 and hdkf API to output usize rather than u64 to not truncate on 32 bit system

Breaking Changes if any:

HKDF API signature changed:

pub fn hkdf(
    hmac_algorithm: HmacAlgorithm,
    key_material: &[u8],
    salt: &[u8],
    info: &[u8],
    output_key_size: usize, <----- Changed from u64
) -> Result<Vec<u8>, SymCryptError> {

Same applies for Sp800 but the change is not in cargo yet.

✅ Admin Checklist

  • Review the PR description and ensure all necessary details are included.
  • Update/add unit tests for changed code.
  • Update/add documentation for new or changed APIs.
  • Run cargo test --all-features on Windows and WSL.

Check the Developer Guidelines in DEVELOPER.md for more info.

@nnmkhang Khang (nnmkhang) linked an issue May 20, 2026 that may be closed by this pull request
@mlindgren

Copy link
Copy Markdown
Member

lgtm

@nnmkhang
Khang (nnmkhang) marked this pull request as ready for review May 21, 2026 23:27
@nnmkhang
Khang (nnmkhang) merged commit 2d83888 into release/0.6.0 May 22, 2026
26 of 27 checks passed
@nnmkhang
Khang (nnmkhang) deleted the user/khangnguyen/fix-output-key-size-type branch May 22, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change signature for HKDF and Sp800_108.

2 participants