Merge pull request #2087 from ethereum/bls_v4_milagro_patch

Bump milagro_bls_binding to 1.5.0
This commit is contained in:
Danny Ryan 2020-10-06 08:30:47 -06:00 committed by GitHub
commit 29b5efd63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 13 deletions

View File

@ -537,7 +537,7 @@ setup(
"eth-typing>=2.1.0,<3.0.0",
"pycryptodome==3.9.4",
"py_ecc==5.0.0",
"milagro_bls_binding==1.4.0",
"milagro_bls_binding==1.5.0",
"dataclasses==0.6",
"remerkleable==0.1.17",
"ruamel.yaml==0.16.5",

View File

@ -67,11 +67,6 @@ def AggregateVerify(pubkeys, messages, signature):
@only_with_bls(alt_return=True)
def FastAggregateVerify(pubkeys, message, signature):
# TODO: remove it when milagro_bls_binding is fixed
# https://github.com/ChihChengLiang/milagro_bls_binding/issues/19
if Z1_PUBKEY in pubkeys:
return False
try:
result = bls.FastAggregateVerify(list(pubkeys), message, signature)
except Exception:
@ -87,9 +82,6 @@ def Aggregate(signatures):
@only_with_bls(alt_return=STUB_SIGNATURE)
def Sign(SK, message):
# TODO: remove it when https://github.com/sigp/milagro_bls/issues/39 is fixed
if SK == 0:
raise Exception("SK should not be zero")
if bls == py_ecc_bls:
return bls.Sign(SK, message)
else:

View File

@ -83,8 +83,7 @@ def case01_sign():
}
# Edge case: privkey == 0
expect_exception(bls.Sign, ZERO_PRIVKEY, message)
# TODO enable it when milagro_bls is ready for IETF BLS draft 04
# expect_exception(milagro_bls.Sign, ZERO_PRIVKEY_BYTES, message)
expect_exception(milagro_bls.Sign, ZERO_PRIVKEY_BYTES, message)
yield f'sign_case_zero_privkey', {
'input': {
'privkey': encode_hex(ZERO_PRIVKEY_BYTES),
@ -267,8 +266,7 @@ def case04_fast_aggregate_verify():
signatures = [bls.Sign(privkey, SAMPLE_MESSAGE) for privkey in PRIVKEYS]
aggregate_signature = bls.Aggregate(signatures)
assert not bls.FastAggregateVerify(pubkeys_with_infinity, SAMPLE_MESSAGE, aggregate_signature)
# TODO enable it when milagro_bls is ready for IETF BLS draft 04
# assert not milagro_bls.FastAggregateVerify(pubkeys_with_infinity, SAMPLE_MESSAGE, aggregate_signature)
assert not milagro_bls.FastAggregateVerify(pubkeys_with_infinity, SAMPLE_MESSAGE, aggregate_signature)
yield f'fast_aggregate_verify_infinity_pubkey', {
'input': {
'pubkeys': [encode_hex(pubkey) for pubkey in pubkeys_with_infinity],