-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Crypto] use deterministic randomness in C backend #4253
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/blst-based-crypto #4253 +/- ##
=============================================================
- Coverage 54.70% 51.27% -3.44%
=============================================================
Files 701 688 -13
Lines 66415 61562 -4853
=============================================================
- Hits 36333 31564 -4769
- Misses 27150 27478 +328
+ Partials 2932 2520 -412
Flags with carried forward coverage won't be shown. Click here to find out more.
|
FVM Benchstat comparisonThis branch with compared with the base branch onflow:feature/blst-based-crypto commit 2070aa6 The command Collapsed results for better readability
|
cbc553e
to
c590019
Compare
2dbbf93
to
5e01e46
Compare
Relic uses the Kernel internal source of entropy to provide randomness tools that are used by the crypto package. The tools provide random elements in
Fp
,Fr
,E1
andE2
. Since Relic is being replaced by BLST, and BLST does not provide randomness tools, this PR removes the reliance on the Relic random tools.In the crypto library, the random logic in the C layer is replaced by "mapping" functions where seed bytes are mapped to
Fp
,Fr
,E1
andE2
(protocol and test functions). The crypto package C layer does not deal with implementing randomness (to avoid the complexity and possible issues). It relies on randomness created by the upper Go layer (either based on user input seeds or outputs ofcrypto/rand
) depending on the use case:Fr_rand
to useFr_map
instead based on an input seed.crypto/rand
).G2
andE2\G2
. As a consequence, membership check inG2
is implemented and tested.Not done yet: all random tools related to
E1
. SinceG1
andE1
are still using Relic.