Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Jun 14, 2024
1 parent 9732b2d commit b4b01b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Base implementation follows from these papers,
- Craig Costello and Douglas Stebila
4. Pairing implementation
- Realms of pairing
- https://eprint.iacr.org/2013/722.pdf
- https://ia.cr/2013/722.pdf
- Diego F. Aranha, Paulo S. L. M. Barreto, Patrick Longa, and Jefferson E. Ricardini
5. Final exponentiation squarings
- SQUARING IN CYCLOTOMIC SUBGROUPS
Expand Down Expand Up @@ -71,6 +71,7 @@ Exponentiation by `λ` can be broken like this, `6x + 2` + `q` − `q^2` + `q^3`
And `q``q^2` + `q^3` can use Frobenius mappings.

## Extension field operations

* Faster Extension Field multiplications for Emulated Pairing Circuits
- https://hackmd.io/@feltroidprime/B1eyHHXNT
- Feltroid Prime (Garaga)
Expand All @@ -84,20 +85,23 @@ where `R(x)` is a polynomial of degree 11 or less.
### Expanding this to include the whole bit operation inside the miller loop,

#### Schwartz Zippel verification for zero `O` bits,

* Commitment contains 64 coefficients
* F ∈ Fq12, miller loop aggregation
* L1_L2 ∈ Sparse01234, Loop step lines L1 and L2 multiplied for lower degree
* L3 ∈ Sparse034, Last L3 line
* ```F(x) * F(x) * L1_L2(x) * L3(x) = R(x) + Q(x) * P12(x)```

#### Schwartz Zippel verification for non-zero `P`/`N` bits,

* Commitment contains 42 coefficients
* F ∈ Fq12, miller loop aggregation
* L1, L2, L3 ∈ Sparse01234, Loop step lines
* Witness ∈ Fq12, Residue witness (or it's inverse based on the bit value)
* ```F(x) * F(x) * L1(x) * L2(x) * L3(x) * Witness(x) = R(x) + Q(x) * P12(x)```

#### Schwartz Zippel verification for miller loop correction step,

* Commitment contains 42 coefficients
* F ∈ Fq12, miller loop aggregation
* L1, L2, L3 ∈ Sparse01234, Correction step lines
Expand Down
4 changes: 2 additions & 2 deletions src/groth16/schzip_base.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub impl Groth16MillerSteps<
}

// Does the verification
fn verify_miller<
fn schzip_miller<
TLines, TSchZip, +SchZipSteps<TSchZip>, +StepLinesGet<TLines>, +Drop<TLines>, +Drop<TSchZip>
>(
pi_a: AffineG1,
Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn schzip_verify<
// residue_witness_inv as starter to incorporate 6 * x + 2 in the miller loop

// miller loop result
let Fq12 { c0, c1 } = verify_miller(
let Fq12 { c0, c1 } = schzip_miller(
pi_a, pi_b, pi_c, inputs, residue_witness, residue_witness_inv, setup, schzip
);

Expand Down
2 changes: 1 addition & 1 deletion src/groth16/tests_schzip.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn fiat_shamir() {
Option::None => { break; },
};
};
let hash = hasher.finalize();
let _hash = hasher.finalize();

// println!("hash: {hash}");
assert(true, '');
Expand Down

0 comments on commit b4b01b1

Please sign in to comment.