-
Notifications
You must be signed in to change notification settings - Fork 116
feat(cipher): use AES pre/post key schedule circuits #1042
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: dev
Are you sure you want to change the base?
Conversation
| use error::ErrorKind; | ||
|
|
||
| /// AES key schedule: 11 round keys, 16 bytes each. | ||
| type KeyShedule = Array<U8, 176>; |
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.
| type KeyShedule = Array<U8, 176>; | |
| type KeySchedule = Array<U8, 176>; |
|
|
||
| let ks = *self | ||
| .key_schedule | ||
| .get_or_insert(self.alloc_key_schedule(vm)?); |
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.
get_or_insert evaluates eagerly, so self.alloc_key_schedule(vm)? is going to be called on every call to alloc_block
|
|
||
| let ks = *self | ||
| .key_schedule | ||
| .get_or_insert(self.alloc_key_schedule(vm)?); |
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.
ditto
| .map(|(explicit_nonce, counter)| { | ||
| let ks = *self | ||
| .key_schedule | ||
| .get_or_insert(self.alloc_key_schedule(vm)?); |
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.
ditto
This PR takes advantage of the recently added AES pre/post key schedule circuits in
mpzand integrates them into theciphercrate.