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

fix: witnesscalc build #91

Merged
merged 22 commits into from
Oct 21, 2024
Merged

fix: witnesscalc build #91

merged 22 commits into from
Oct 21, 2024

Conversation

Autoparallel
Copy link
Contributor

@Autoparallel Autoparallel commented Oct 11, 2024

To verify this is all working, you can run:

build-circuit circuits/aes-gcm/aes-gcm-fold.circom aes-gcm-fold.bin -l node_modules

to generate the graph file for witness extension.

To see the constraint count for aes-gcm-fold, you can run:

circom circuits/aes-gcm/aes-gcm-fold.circom -l node_modules --r1cs

Currently addresses:


Need to solve:

@Autoparallel Autoparallel marked this pull request as ready for review October 11, 2024 23:45
@Autoparallel
Copy link
Contributor Author

@0xJepsen @thor314 I will need your help to get this to pass tests and what not.

Also the constraints for aes-gcm-fold are now near 1M. We need to reduce this heavily by either folding more or ideally optimizing. Folding more is fine for now. I don't know where the good folding boundaries are, so I'm leaving that for you two to decide on.

@Autoparallel Autoparallel requested review from thor314 and 0xJepsen and removed request for thor314 October 16, 2024 21:25
@Autoparallel
Copy link
Contributor Author

All tests are passing, but I would appreciate reviewers giving this another look to make sure that this is still totally working as expected.

@Autoparallel
Copy link
Contributor Author

Autoparallel commented Oct 16, 2024

Potential improvement noted here

// TODO: Remove this blocks-to-stream translation by migrating the ghash select

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.

I reviewed this when I updated the tests and confirmed that the changes are working as expected. From my PoV this is ready to go, the primary blocker atm is that it's dependent on the PP PR (the circuit interface changes)

We can probably merge this now, given that upstream repos should be pinned to a specific version of aes-proof.

@thor314
Copy link
Contributor

thor314 commented Oct 18, 2024

  • aes-gcm-fold is difficult to read as is, could use comments
  • replace todos
  • many magic numbers in Cipher, consider replacing with named variables for readability
  • ff circom could use some comments to explain the longer but more efficient approach

If helpful, my espanso todo replacement snippets:

# espanso replace snippet
  - triggers: ["TODO ", "tdd "]
    replace: "TODO(TK {{date}}): "  
    vars:
      - name: date
        type: date
        params:
          format: "%Y-%m-%d"
  - triggers: ["tdb "]
    replace: "- [ ] TODO(TK {{date}}): "  
    vars:
      - name: date
        type: date
        params:
          format: "%Y-%m-%d"
  - triggers: ["tdc "]
    replace: "// TODO(TK {{date}}): "  
    vars:
      - name: date
        type: date
        params:
          format: "%Y-%m-%d"
  - triggers: ["tdp "]
    replace: "TODO(TK): "  

@thor314
Copy link
Contributor

thor314 commented Oct 21, 2024

@Autoparallel, this looks good to go after the comments I made above

Copy link
Contributor

@0xJepsen 0xJepsen left a comment

Choose a reason for hiding this comment

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

nice work on this

@thor314 thor314 merged commit ac209d7 into main Oct 21, 2024
3 checks passed
@thor314
Copy link
Contributor

thor314 commented Oct 21, 2024

@devloper @Autoparallel Would you annotate your todos:

TODO(<initials> <date>): <comment>

e.g.
TODO(TK 2024-10-21): readability: add comments about what this does

a bare TODO is nice for working alone, but it doesn't say much about how old the thing is for the reader; makes me git blame to see all the relevant metadata

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.

golf: use the lookup into FF inverse method to save constraints
4 participants