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

🗼 Tower Extensions (Fq2, Fq6, and Fq12) and Torus Compression for BN254 precompiles #38

Draft
wants to merge 109 commits into
base: dl-precompiles
Choose a base branch
from

Conversation

ZamDimon
Copy link

@ZamDimon ZamDimon commented Mar 29, 2024

What ❔

This pull request primarily focuses on helper gadgets for EC pairing implementation under the constraint system.

To implement pairing, we introduce the following new functionality:

  • Tower extension $\mathbb{F}_{p^2} \mapsto \mathbb{F}_{p^6} \mapsto \mathbb{F}_{p^{12}}$ under the constraint system.
  • Twisted elliptic curve $E'(\mathbb{F}_{p^2})$ support.
  • Consequently, we implement the NonNativeField<F, T> trait over $\mathbb{F}_{p^k}$ extensions and basic arithmetic for all of the extensions.
  • Torus compression ($\mathbb{T}_2$) that makes final exponentiation step more R1CS-friendly.

Why ❔

  1. Currently, no EC pairing is implemented under the constraint system.
  2. Field extensions are implemented outside the constraint system (see here); however, no such functionality is available under the constraint system.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.

ZamDimon and others added 28 commits March 12, 2024 16:12
…-trait-impls`

🗼 Tower Extension Implementation
@ZamDimon ZamDimon marked this pull request as draft March 29, 2024 16:00
ZamDimon and others added 30 commits May 28, 2024 15:42
this commit also adds some assertions to make sure that we never
overflow max_mods_to_fit.
⚡ Torus Optimized Operations
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.

None yet

4 participants