Skip to content
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

feat: generic chunked aes nivc #44

Merged
merged 5 commits into from
Nov 14, 2024
Merged

Conversation

Autoparallel
Copy link
Contributor

@Autoparallel Autoparallel commented Nov 13, 2024

Implements a foldable AES GCTR for arbitrary amount of chunks. Tested with both 1 and 2 chunk mode.

@Autoparallel Autoparallel force-pushed the feat/generic-chunked-aes-nivc branch from ff6241c to e18a2b7 Compare November 13, 2024 19:04
@Autoparallel Autoparallel marked this pull request as ready for review November 13, 2024 19:44
if(i == 0) {
hash = PoseidonChainer()([step_in[0],packedPlaintext[i]]);
} else {
hash = PoseidonChainer()([hash, packedPlaintext[i]]);
Copy link
Collaborator

@lonerapier lonerapier Nov 13, 2024

Choose a reason for hiding this comment

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

this doesn't look constrained properly? i'm curious about r1cs size as well because this was the exact reason of increased size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wdym?

@lonerapier
Copy link
Collaborator

what if i want to do 15 folds in a 2 chunk AES? is that possible or we have to add 2 different circuits to the ROM? so 7 2-chunk + 1 1-chunk circuit?

suggestion from Sambhav

Co-authored-by: Sambhav Dusad <[email protected]>
@Autoparallel
Copy link
Contributor Author

what if i want to do 15 folds in a 2 chunk AES? is that possible or we have to add 2 different circuits to the ROM? so 7 2-chunk + 1 1-chunk circuit?

I think we'd probably pick an optimal size be it 2,4,8 chunks at a time, then always have a single chunk circuit as backup to fill in the remainder.

@Autoparallel
Copy link
Contributor Author

As of the last changes we have: AESGCTR_512b: 42.7MB

@lonerapier lonerapier self-requested a review November 14, 2024 04:53
Copy link
Collaborator

@lonerapier lonerapier left a comment

Choose a reason for hiding this comment

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

epic cooking, merging this. we inch closer every second!!

@lonerapier lonerapier merged commit 52d4bf6 into main Nov 14, 2024
3 checks passed
@lonerapier lonerapier deleted the feat/generic-chunked-aes-nivc branch November 14, 2024 04:54
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.

2 participants