BLS signature v4 (#1912)

This commit is contained in:
Mamy Ratsimbazafy 2020-10-27 09:37:04 +01:00 committed by GitHub
parent 8102d5dc4d
commit 677f099110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -88,7 +88,9 @@ func toPubKey*(privkey: ValidatorPrivKey): ValidatorPubKey =
## Create a private key from a public key ## Create a private key from a public key
# Un-specced in either hash-to-curve or Eth2 # Un-specced in either hash-to-curve or Eth2
# TODO: Test suite should use `keyGen` instead # 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] = proc toRealPubKey(pubkey: ValidatorPubKey): Option[ValidatorPubKey] =
var validatorKeyCache {.threadvar.}: var validatorKeyCache {.threadvar.}:

2
vendor/nim-blscurve vendored

@ -1 +1 @@
Subproject commit 9b1cf54f47e704ed52c70ef55674dbfbe0aefa8d Subproject commit 3878b9bf324fd895f07f2c3a07622fac7c939e21