mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-18 22:51:13 +00:00
make BLS test format and output consistent with spec
This commit is contained in:
parent
bf618f8d28
commit
91f55f55b5
@ -7,7 +7,7 @@ A BLS compressed-hash to G2.
|
||||
```yaml
|
||||
input:
|
||||
message: bytes32,
|
||||
domain: bytes -- any number
|
||||
domain: uint64 -- the BLS domain
|
||||
output: List[bytes48] -- length of two
|
||||
```
|
||||
|
||||
|
@ -6,8 +6,8 @@ A BLS uncompressed-hash to G2.
|
||||
|
||||
```yaml
|
||||
input:
|
||||
message: bytes32,
|
||||
domain: bytes -- any number
|
||||
message: bytes32
|
||||
domain: uint64 -- the BLS domain
|
||||
output: List[List[bytes48]] -- 3 lists, each a length of two
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ Message signing with BLS should produce a signature.
|
||||
input:
|
||||
privkey: bytes32 -- the private key used for signing
|
||||
message: bytes32 -- input message to sign (a hash)
|
||||
domain: bytes -- BLS domain
|
||||
domain: uint64 -- the BLS domain
|
||||
output: bytes96 -- expected signature
|
||||
```
|
||||
|
||||
|
@ -27,9 +27,6 @@ def hex_to_int(x: str) -> int:
|
||||
return int(x, 16)
|
||||
|
||||
|
||||
# Note: even though a domain is only an uint64,
|
||||
# To avoid issues with YAML parsers that are limited to 53-bit (JS language limit)
|
||||
# It is serialized as an hex string as well.
|
||||
DOMAINS = [
|
||||
0,
|
||||
1,
|
||||
@ -92,7 +89,7 @@ def case01_message_hash_G2_uncompressed():
|
||||
yield {
|
||||
'input': {
|
||||
'message': '0x' + msg.hex(),
|
||||
'domain': int_to_hex(domain)
|
||||
'domain': domain
|
||||
},
|
||||
'output': hash_message(msg, domain)
|
||||
}
|
||||
@ -104,7 +101,7 @@ def case02_message_hash_G2_compressed():
|
||||
yield {
|
||||
'input': {
|
||||
'message': '0x' + msg.hex(),
|
||||
'domain': int_to_hex(domain)
|
||||
'domain': domain
|
||||
},
|
||||
'output': hash_message_compressed(msg, domain)
|
||||
}
|
||||
@ -129,7 +126,7 @@ def case04_sign_messages():
|
||||
'input': {
|
||||
'privkey': int_to_hex(privkey),
|
||||
'message': '0x' + message.hex(),
|
||||
'domain': int_to_hex(domain)
|
||||
'domain': domain
|
||||
},
|
||||
'output': '0x' + sig.hex()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user