-
Notifications
You must be signed in to change notification settings - Fork 1.7k
migrate kbkdfhmac to rust #13800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
migrate kbkdfhmac to rust #13800
Conversation
4fe36d8 to
f619010
Compare
f619010 to
ec2ca6c
Compare
|
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()); |
There was a problem hiding this comment.
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
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)