This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
BLS Core Crypto attempt #2 #13618
Merged
Lederstrumpf
merged 49 commits into
paritytech:master
from
w3f:davxyn-skalman-core-bls-crypto
May 9, 2023
Merged
BLS Core Crypto attempt #2 #13618
Changes from 3 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
b845210
Cherry pick all crypto related changes from pull-request #13311
drskalman 081ced0
Merge branch 'master' into davxyn-skalman-core-bls-crypto
davxy f411d74
Merge branch 'master' into davxyn-skalman-core-bls-crypto
davxy ee61ddb
Import some stuff just if 'full_crypto' is on
davxy a1e0f13
Remove copyright year
davxy 7023c14
Cleanup
davxy d92186d
First generic BLS draft
davxy 409b2f4
Finalize generic implementation
davxy 7177bb1
Restore tests
davxy 9b320cd
Merge pull request #13 from davxy/davxyn-skalman-core-bls-crypto-generic
davxy 58d4122
Fix rust docs
davxy 1e331c0
Merge branch 'master' into davxyn-skalman-core-bls-crypto
davxy a630ead
Fix after master merge
davxy 8a34867
Merge branch 'master' into davxyn-skalman-core-bls-crypto
davxy 5c47d33
Fix after master merge
davxy fe65fce
Use double bls with G1 as signature group and verify individual signa…
drskalman b278ba7
Fix inclusions and types used within substrate
davxy 3d50a72
Remove unused cruft
davxy 994a805
Restore usage of upstream crates
davxy d728537
Fix test
davxy fbb2f47
Reduce the diff by aligning Cargo.lock to master
davxy bc52143
Application-crypto provides bls381
davxy eb8a7ab
Merge branch 'master' into davxyn-skalman-core-bls-crypto
davxy 0acdf5c
Implement bls381 for local keystore
davxy 26d9ce2
Merge branch 'master' into davxyn-skalman-core-bls-crypto
davxy 9de1515
Use new generic keystore features
davxy 267538f
import DoublePublickey[Scheme] from the bls-like root to be less conf…
drskalman e3c2af8
Merge branch 'master' into davxyn-skalman-core-bls-crypto
andresilva 2a0a0ca
fix compilation
andresilva de48262
Apply suggestions from code review
davxy 7d709da
Clean leftovers
davxy a2b7308
- update bls test vector after applying spec change recommendation.
drskalman 478da9b
Merge branch 'davxyn-skalman-core-bls-crypto' of https://github.com/w…
drskalman 426c5ae
Different hard junction ids for different bls12 types
davxy da36af4
update to new bls-like
drskalman 856881a
Merge branch 'davxyn-skalman-core-bls-crypto' of https://github.com/w…
drskalman 0c7a5f7
bls-like → w3f-bls
drskalman 9218d9c
Make clippy happy
davxy 58c2d94
update test vector after replacing hash and crop with hash to field.
drskalman 6041fec
cargo fmt
drskalman f9b0da0
Merge branch 'master' into davxyn-skalman-core-bls-crypto
drskalman 758a169
Merge remote-tracking branch 'upstream/master' into HEAD
Lederstrumpf b11659d
account for #13972
Lederstrumpf 3a9c5ed
hide BLS behind "bls_non_production" feature flag
Lederstrumpf 0bfbcfd
Merge remote-tracking branch 'upstream/master' into davxyn-skalman-co…
Lederstrumpf 5a1a9cc
Remove Cargo.lock entries duplicated in merge
Lederstrumpf 2e48a99
add bls377 to primitives/keystore and client/keystore
drskalman 270b32e
rename feature `bls_non_production` to `bls-experimental`
drskalman 35b9167
Merge branch 'master' into davxyn-skalman-core-bls-crypto
drskalman 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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.
Imho, we should not depend upon the
EngineBLStrait here. It's completely useless. It'll also cause issues for portability and maintenance.Uh oh!
There was an error while loading. Please reload this page.
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.
bls crypto type within substrate has been defined to be generic.
This allowed to easily have both bls12-381 and bls12-377 with the minimum effort and code duplication.
To have such kind of generic we bounded the generic type to be an
EngineBLStrait.AFAIK is the only bound that allow us to do provide a generic implementation.
What you suggest as an alternative bound?
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.
We should not imho use the bls-like crate in production. I started it as an experiment, and much has been added, but it was never cleaned up, so much of what is there no longer serves any purpose, and is generally a confusing poorly structured mess. https://github.com/w3f/ring-vrf/tree/master/nugget_bls was written to do exactly what beefy requires.
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.
I made this repo https://github.com/w3f/BCLS-BLS I'll start isolating the bls logic from nugget and bls-like to here and eventually relpace the backend.
Nonetheless I don't want this to become a blocker on this pull requset as, given that the output of the BLS-like matches the reference in the paper, BEEFY's integration is blocked on this, production ready BLS BEEFY is also blocked on apk proof adoption of BW6 on BLS12-381 and we are exposing no host functio.
Therefore, I don't think blocking the pull request due to some opinion about an abstraction in the backend is justified.
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.
Or just use nugget_bls after changing whatever needs changing? At minimum it helps consolidate our code which should be hardened for non-constant-time elliptic curves.
I've found an unrelated annoyance with merlin, so I'll do some ark_transcript crate based on shake128 btw.