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

Add support for custom BigInt Moduli #4676

Closed
Tracked by #510
michaelelliot opened this issue Feb 20, 2024 · 3 comments
Closed
Tracked by #510

Add support for custom BigInt Moduli #4676

michaelelliot opened this issue Feb 20, 2024 · 3 comments
Labels
C-barretenberg Component: barretenberg cryptography library

Comments

@michaelelliot
Copy link
Contributor

I’ve been using the new BigInt feature in Noir, and was able to decrypt an RSA signature using a 2048 bit modulus.

However, while it successfully decrypted the RSA signature (confirmed via println), it also produced the error: The backend encountered an error: Assertion failed. See bigint_constraint.cpp#L360

Currently the barretenberg backend only supports 6 different moduli for foreign field arithmetic, and so although it appeared to work, this couldn't be used for creating actual proofs with constraints.

The current approach works well for BN254, ECDSA, EdDSA and other signature algorithms/curves with a fixed modulus, but not so much for non-curve algorithms like RSA, where the modulus changes with each keypair.

Some questions:

  • Is it possible to add support for arbitrary moduli, specifiable in Noir, or does each modulus need to be hardcoded into the backend prover?
  • Is it possible to use a foreign field size that's larger than the native field size in foreign field arithmetic?
  • Is it possible to add support for a larger modulus (e.g. 512 bits) by using more 64bit limbs? See bigint_constraint.cpp#L309 (Or would this be restricted by the BN254 native field size?)

Related:

@github-project-automation github-project-automation bot moved this to Todo in A3 Feb 20, 2024
@Savio-Sou Savio-Sou changed the title Restrictions on BigInt Moduli Add support for custom BigInt Moduli Mar 4, 2024
@Savio-Sou Savio-Sou added the C-barretenberg Component: barretenberg cryptography library label Mar 4, 2024
@signorecello
Copy link
Contributor

Seems like this won't happen after all @Savio-Sou ? This seems critical for RSA thus passport verification, zkEmail, and some other things (cc @joeandrews)

@Savio-Sou
Copy link
Member

We closed #5327 due to Barretenberg team's concern on merging the PR.

Meanwhile, we've come up with a design spec that should be implementable in pure Noir.

We're looking for a community team to implement the specs and maintain the library. (Readers interested, do reach out.)

@Savio-Sou
Copy link
Member

That said, this Issue is no longer relevant to live in this repository as the aim shifts towards a standalone BigUInt library implementing the specs linked above.

Closing this as not planned accordingly.

@Savio-Sou Savio-Sou closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-barretenberg Component: barretenberg cryptography library
Projects
Archived in project
Development

No branches or pull requests

4 participants