Skip to content

Conversation

@themighty1
Copy link
Member

This PR takes advantage of the recently added AES pre/post key schedule circuits in mpz and integrates them into the cipher crate.

@themighty1 themighty1 requested a review from sinui0 October 31, 2025 12:44
use error::ErrorKind;

/// AES key schedule: 11 round keys, 16 bytes each.
type KeyShedule = Array<U8, 176>;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type KeyShedule = Array<U8, 176>;
type KeySchedule = Array<U8, 176>;


let ks = *self
.key_schedule
.get_or_insert(self.alloc_key_schedule(vm)?);
Copy link
Member

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)?);
Copy link
Member

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)?);
Copy link
Member

Choose a reason for hiding this comment

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

ditto

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.

3 participants