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

aes gcm #71

Merged
merged 11 commits into from
Sep 17, 2024
Merged

aes gcm #71

merged 11 commits into from
Sep 17, 2024

Conversation

thor314
Copy link
Contributor

@thor314 thor314 commented Sep 16, 2024

No description provided.

Copy link
Contributor

@devloper devloper left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work.

For sequential proving it seems very close. We should be able to have this working today!

/// cipherText: encrypted ciphertext
/// authTag: authentication tag
///
template AESGCM(l) {
Copy link
Contributor

Choose a reason for hiding this comment

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

AES_GCM_128 might be a more precise name, unless we want to modify this to very over key/iv size.

incJ0.in <== J0;

// TODO(WJ 2024-09-09): stopping point
component gctr = GCTR(l, nk);
Copy link
Contributor

Choose a reason for hiding this comment

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

where is nk defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should set it as a param to allow for many keys

var v = 128 * Math.ceil(additionalData.length / 128) - additionalData.length;

// Step 5: Define a block, S
component ghash = GHASH();
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this is setup to handle "l" bits of plaintext, but this doesn't seems to accept a variable number of ciphertext bits.

// generate plaintext blocks
// note to not use the last block of plaintext
// because it will be padded byt the toBlocks components
component plainTextBlocks = ToBlocks(INPUT_LEN);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of moving between blocks and stream in circuit, would it make more sense to accept input as sequence of blocks?

@0xJepsen 0xJepsen merged commit 2647ef5 into main Sep 17, 2024
2 checks passed
@thor314
Copy link
Contributor Author

thor314 commented Sep 17, 2024

nice

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