Skip to content

CIP-0133: Add BLS12-381 multi scalar #7151

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

perturbing
Copy link
Contributor

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@@ -170,3 +171,10 @@ memSizeBytes = BlstBindings.Internal.sizePoint (Proxy @BlstBindings.Curve1)
-- | Compressed size of a G1 point (48 bytes)
compressedSizeBytes :: Int
compressedSizeBytes = BlstBindings.Internal.compressedSizePoint (Proxy @BlstBindings.Curve1)

-- | Multi-scalar multiplication of G1 points.
-- Uses MSM when the number of pairs exceeds a threshold (currently 10).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwxm when costing, we should run the bench against different thresholds here. This 10 is an arbitrary value I randomly picked, I remember from the initial rust benchmarking @dkaidalov did, this threshold was 30, but I am unsure. Do you remember Dmytro?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what threshold do you mean? From my benchmarks the blst MSM is more efficient than naive impl already from the size of 3. There is indeed a threshold at 30, when the blst lib becomes suddenly several times more efficient (if I remember correctly there is some MSM mechanism switching at 30, programmed in rust bindings)

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.

2 participants