Skip to content

Commit

Permalink
Merge pull request #21 from ChihChengLiang/bump-upstream-to-v1.3.0
Browse files Browse the repository at this point in the history
Bump Milagro BLS to v1.3.0
  • Loading branch information
ChihChengLiang committed Oct 6, 2020
2 parents 1e3864b + 1cfd969 commit e0a71d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "milagro-bls-binding"
version = "1.4.0"
version = "1.5.0"
edition = "2018"
authors = ["chihchengliang@gmail.com"]

Expand All @@ -23,4 +23,4 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.10.1", features = ["extension-module"] }
milagro_bls = {git = "https://github.com/sigp/milagro_bls", tag= "v1.2.0" }
milagro_bls = {git = "https://github.com/sigp/milagro_bls", tag= "v1.3.0" }
19 changes: 8 additions & 11 deletions test.py
Expand Up @@ -59,14 +59,6 @@ def test_sign_verify(privkey_int):
assert bls.Verify(pub, msg, sig)


def test_sign_verify_zero():
privkey = to_bytes(0)
msg = "foooooo".encode('utf-8')
pub = bls.SkToPk(privkey)
sig = bls.Sign(privkey, msg)
assert not bls.Verify(pub, msg, sig)


@pytest.mark.parametrize(
'signature_points,result_point',
[
Expand Down Expand Up @@ -94,6 +86,11 @@ def test_fast_aggregate_verify(SKs, message):


def test_weird_cases():
bad_signature = b'\x00' * 96
assert not bls.AggregateVerify([], [], bad_signature)
assert bls.Aggregate([]) == b'\xc0' + b'\x00' * 95
Z1_PUBKEY = b'\xc0' + b'\x00' * 47
Z2_SIGNATURE = b'\xc0' + b'\x00' * 95
assert not bls.AggregateVerify([], [], Z2_SIGNATURE)
assert bls.Aggregate([]) == Z2_SIGNATURE
with pytest.raises(ValueError):
bls.Sign(to_bytes(0), b'abcd')
assert not bls.Verify(Z1_PUBKEY, b'abcd', Z2_SIGNATURE)
assert not bls.FastAggregateVerify([Z1_PUBKEY], b'abcd', Z2_SIGNATURE)

0 comments on commit e0a71d5

Please sign in to comment.