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

Bls signature v4 #1912

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion beacon_chain/spec/crypto.nim
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ func toPubKey*(privkey: ValidatorPrivKey): ValidatorPubKey =
## Create a private key from a public key
# Un-specced in either hash-to-curve or Eth2
# TODO: Test suite should use `keyGen` instead
ValidatorPubKey(kind: Real, blsValue: SecretKey(privkey).privToPub())
result.kind = Real
let ok = result.blsValue.publicFromSecret(SecretKey privkey)
doAssert ok, "The validator private key was a zero key. This should never happen."

proc toRealPubKey(pubkey: ValidatorPubKey): Option[ValidatorPubKey] =
var validatorKeyCache {.threadvar.}:
Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-blscurve
Submodule nim-blscurve updated 73 files
+1 −2 blscurve.nim
+0 −2 blscurve.nimble
+2 −2 blscurve/bls_backend.nim
+31 −24 blscurve/blst/bls_sig_min_pubkey_size_pop.nim
+1 −2 blscurve/eth2_keygen/hkdf_mod_r_blst.nim
+5 −3 blscurve/eth2_keygen/hkdf_mod_r_miracl.nim
+16 −0 blscurve/miracl/bls_sig_io.nim
+101 −23 blscurve/miracl/bls_signature_scheme.nim
+4 −0 blscurve/miracl/common.nim
+0 −0 ...tors/aggregate/small/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000/data.yaml
+0 −0 ...tors/aggregate/small/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656/data.yaml
+0 −0 ...tors/aggregate/small/aggregate_0xabababababababababababababababababababababababababababababababab/data.yaml
+2 −0 tests/eth2.0_v1.0.0-rc0_vectors/aggregate/small/aggregate_infinity_signature/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/aggregate/small/aggregate_na_signatures/data.yaml
+10 −0 tests/eth2.0_v1.0.0-rc0_vectors/aggregate_verify/small/aggregate_verify_infinity_pubkey/data.yaml
+0 −0 ...h2.0_v1.0.0-rc0_vectors/aggregate_verify/small/aggregate_verify_na_pubkeys_and_infinity_signature/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/aggregate_verify/small/aggregate_verify_na_pubkeys_and_na_signature/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/aggregate_verify/small/aggregate_verify_tampered_signature/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/aggregate_verify/small/aggregate_verify_valid/data.yaml
+0 −0 ...1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_extra_pubkey_4f079f946446fabf/data.yaml
+0 −0 ...1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd/data.yaml
+0 −0 ...1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_extra_pubkey_a698ea45b109f303/data.yaml
+8 −0 tests/eth2.0_v1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_infinity_pubkey/data.yaml
+0 −0 ...0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_na_pubkeys_and_infinity_signature/data.yaml
+0 −0 ..._v1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_na_pubkeys_and_na_signature/data.yaml
+0 −0 ...rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_tampered_signature_3d7576f3c0e3570a/data.yaml
+0 −0 ...rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_tampered_signature_5e745ad0c6199a6c/data.yaml
+0 −0 ...rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_tampered_signature_652ce62f09290811/data.yaml
+0 −0 ...th2.0_v1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_valid_3d7576f3c0e3570a/data.yaml
+0 −0 ...th2.0_v1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_valid_5e745ad0c6199a6c/data.yaml
+0 −0 ...th2.0_v1.0.0-rc0_vectors/fast_aggregate_verify/small/fast_aggregate_verify_valid_652ce62f09290811/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_11b8c7cad5238946/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_142f678a8d05fcd1/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_37286e1a6d1f6eb3/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_7055381f640f2c1d/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_84d45c9c7cca6b92/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_8cd3d4d0d9a5b265/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_c82df61aa3ee60fb/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_d0e28d7e76eb6e9c/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_f2ae1097e7d0e18b/data.yaml
+3 −0 tests/eth2.0_v1.0.0-rc0_vectors/sign/small/sign_case_zero_privkey/data.yaml
+2 −2 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_infinity_pubkey_and_infinity_signature/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_195246ee3bd3b6ec/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_2ea479adf8c40300/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_2f09d443ab8a3ac2/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_3208262581c8fc09/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_6b3b17f6962a490c/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_6eeb7c52dfd9baf0/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_8761a0b7e920c323/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_d34885d766d5f705/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_tampered_signature_case_e8a50c445c855360/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_195246ee3bd3b6ec/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_2ea479adf8c40300/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_2f09d443ab8a3ac2/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_3208262581c8fc09/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_6b3b17f6962a490c/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_6eeb7c52dfd9baf0/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_8761a0b7e920c323/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_d34885d766d5f705/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_valid_case_e8a50c445c855360/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_195246ee3bd3b6ec/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_2ea479adf8c40300/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_2f09d443ab8a3ac2/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_3208262581c8fc09/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_6b3b17f6962a490c/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_6eeb7c52dfd9baf0/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_8761a0b7e920c323/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_d34885d766d5f705/data.yaml
+0 −0 tests/eth2.0_v1.0.0-rc0_vectors/verify/small/verify_wrong_pubkey_case_e8a50c445c855360/data.yaml
+89 −86 tests/eth2_vectors.nim
+8 −3 tests/priv_to_pub.nim
+1 −1 tests/test_locator.nim
+1 −1 vendor/blst