Skip to content

Big optmizations to ecAdd, ecMul and ecPairing and small refactor - #328

Draft
hecmas wants to merge 12 commits into
develop-feijoafrom
feature/bn254-optz
Draft

Big optmizations to ecAdd, ecMul and ecPairing and small refactor#328
hecmas wants to merge 12 commits into
develop-feijoafrom
feature/bn254-optz

Conversation

@hecmas

@hecmas hecmas commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

This PR contains the following significative optimizations:

  • ecMul.zkasm calls to ecAdd.zkasm now to avoid unnecessary checks.
  • Added a new file doublePointBN254.zkasm to perform doublings.
  • ecMul.zkasm now does not use any binary to perform the scalar k reconstruction.
  • A new file bitwiseReconstruction.zkasm has been added to allow "fill in" the missing bits of a particular $256$-bit number.
  • Some files renaming, to be more consistent with the theory; e.g., instead of scalarMulBN254, we now use scalarMulFP2BN254 to put emphasy on the underlying finite field.
  • All scalar reconstructions have been optimized with the slogan: "focus on verifying, not computing".
  • Minor optimizations and reorganizations of the code.
  • A new function has been added to perform point scalar multiplication by $6 x^2$ directly, where $x$ is the BN254 generator parameter.
  • Added explicit counters for ecAdd, ecMul and ecPairing.

@hecmas hecmas self-assigned this Feb 5, 2024
@cla-bot cla-bot Bot added the cla-signed label Feb 5, 2024
@hecmas hecmas changed the title Big optmizations to ecPairing and small refactor Big optmizations to ecAdd, ecMul and ecPairing and small refactor Feb 5, 2024
@hecmas
hecmas changed the base branch from develop-feijoa to feature/precompiled-optz February 5, 2024 19:03
@hecmas
hecmas changed the base branch from feature/precompiled-optz to develop-feijoa February 5, 2024 19:05
@hecmas
hecmas changed the base branch from develop-feijoa to develop February 6, 2024 17:06
@hecmas
hecmas changed the base branch from develop to develop-feijoa February 6, 2024 17:06
@krlosMata
krlosMata marked this pull request as draft February 7, 2024 13:52
@hecmas hecmas added this to the fork-feijoa milestone Feb 22, 2024
@hecmas
hecmas marked this pull request as ready for review February 22, 2024 08:39
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@hecmas
hecmas requested a review from zkronos73 as a code owner March 7, 2024 12:08
@krlosMata
krlosMata marked this pull request as draft March 22, 2024 15:42
@hecmas
hecmas force-pushed the feature/bn254-optz branch from cb4a5e6 to d8011e4 Compare May 30, 2024 15:54
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants