Skip to content

Conversation

@reaperhulk
Copy link
Member

Since this only migrates the HMAC part there is a lot of duplication, which will be removed when CMAC gets migrated. To review the logic you'll need to look at the _KBKDFDeriver class (which isn't removed since KBKDFCMAC still depends on it)

@reaperhulk reaperhulk force-pushed the kdf-try-again branch 4 times, most recently from 4fe36d8 to f619010 Compare November 4, 2025 15:33
@reaperhulk reaperhulk marked this pull request as ready for review November 4, 2025 16:20
@reaperhulk
Copy link
Member Author

These commits can be reviewed separately to make it a bit easier to follow. The second also provides coverage since we need a test to pass an incorrect buffer size.

}

// llen will exist if fixed data is not provided
let l_val = int_to_bytes(self.length * 8, self.params.llen.unwrap());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't ever verify the range of llen, but int_to_bytes will panic if it's too big: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a4c1b2f7067040c7a9f906a14fe15f0b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants