Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

🗼 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 29 commits May 28, 2024 18:11
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants