This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
feat: implement g1_mul #19
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b0cdbcd
added the rest of bls12-381 precompile entrypoints
fgimenez 51526ec
initial implementation
fgimenez 47c75f5
use bls12_381 crate, g1add complete
fgimenez c05c823
more tests and take into account point of inifinity; more constants
fgimenez b0e8676
added the rest of bls12-381 precompile entrypoints
fgimenez e088b49
implement g1 mul
fgimenez f7b54dd
add tests
fgimenez 45b4097
mul implementation plus more tests
fgimenez 5b889a5
remove leftovers
fgimenez c20e708
more test cases
fgimenez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like
G1Projective
implementsmultiply
(andMul<Scalar>
), so we probably don't need to reimplement double-and-addThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, I started using the methods you mentioned but the results didn't match the test vectors. Finally ended up writing a direct translation of the method used in geth https://github.com/ethereum/go-ethereum/blob/master/crypto/bls12381/g1.go#L345-L356, with this everything is ok.
As you said, with the move to blst everything will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, interesting, let's keep this as-is then, and see what happens after blst