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

Perturbing/add msm bls #514

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

perturbing
Copy link
Contributor

Description

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Commits that only contain large amounts of formatting changes were added to .git-blame-ignore-revs
  • Self-reviewed the diff

Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Haven't looked into ffi calls, just at the haskell portion of it.
I'll look into this in more depth once PR is out of draft

blsMSM :: forall curve. BLS curve => [Point curve] -> [Scalar] -> Either BLSTError (Point curve)
blsMSM ps ss
| null ps || null ss = Left BLST_UNKNOWN_ERROR
| length ps /= length ss = Left BLST_UNKNOWN_ERROR
Copy link
Collaborator

Choose a reason for hiding this comment

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

Documentation says "The number of points must be equal or smaller than the number of scalars."

Suggested change
| length ps /= length ss = Left BLST_UNKNOWN_ERROR
| length ps <= length ss = Left BLST_UNKNOWN_ERROR

In any case, with my suggestion on the type of function arguments this check could be removed as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct that the underlying blst implementation allows for it, but it just doesn't use the excess scalars. CIP-0133 constrains it to be equal size.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case the haddock is wrong

@perturbing
Copy link
Contributor Author

Thank you for taking a first look @lehins, much appreciated!

The FFI is not working yet, I am getting some segmentation faults that I am trying to debug with valgrind.

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