mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-19 07:03:12 +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
|
```yaml
|
||||||
input:
|
input:
|
||||||
message: bytes32,
|
message: bytes32,
|
||||||
domain: bytes -- any number
|
domain: uint64 -- the BLS domain
|
||||||
output: List[bytes48] -- length of two
|
output: List[bytes48] -- length of two
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ A BLS uncompressed-hash to G2.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
input:
|
input:
|
||||||
message: bytes32,
|
message: bytes32
|
||||||
domain: bytes -- any number
|
domain: uint64 -- the BLS domain
|
||||||
output: List[List[bytes48]] -- 3 lists, each a length of two
|
output: List[List[bytes48]] -- 3 lists, each a length of two
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ Message signing with BLS should produce a signature.
|
|||||||
input:
|
input:
|
||||||
privkey: bytes32 -- the private key used for signing
|
privkey: bytes32 -- the private key used for signing
|
||||||
message: bytes32 -- input message to sign (a hash)
|
message: bytes32 -- input message to sign (a hash)
|
||||||
domain: bytes -- BLS domain
|
domain: uint64 -- the BLS domain
|
||||||
output: bytes96 -- expected signature
|
output: bytes96 -- expected signature
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -27,9 +27,6 @@ def hex_to_int(x: str) -> int:
|
|||||||
return int(x, 16)
|
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 = [
|
DOMAINS = [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
@ -92,7 +89,7 @@ def case01_message_hash_G2_uncompressed():
|
|||||||
yield {
|
yield {
|
||||||
'input': {
|
'input': {
|
||||||
'message': '0x' + msg.hex(),
|
'message': '0x' + msg.hex(),
|
||||||
'domain': int_to_hex(domain)
|
'domain': domain
|
||||||
},
|
},
|
||||||
'output': hash_message(msg, domain)
|
'output': hash_message(msg, domain)
|
||||||
}
|
}
|
||||||
@ -104,7 +101,7 @@ def case02_message_hash_G2_compressed():
|
|||||||
yield {
|
yield {
|
||||||
'input': {
|
'input': {
|
||||||
'message': '0x' + msg.hex(),
|
'message': '0x' + msg.hex(),
|
||||||
'domain': int_to_hex(domain)
|
'domain': domain
|
||||||
},
|
},
|
||||||
'output': hash_message_compressed(msg, domain)
|
'output': hash_message_compressed(msg, domain)
|
||||||
}
|
}
|
||||||
@ -129,7 +126,7 @@ def case04_sign_messages():
|
|||||||
'input': {
|
'input': {
|
||||||
'privkey': int_to_hex(privkey),
|
'privkey': int_to_hex(privkey),
|
||||||
'message': '0x' + message.hex(),
|
'message': '0x' + message.hex(),
|
||||||
'domain': int_to_hex(domain)
|
'domain': domain
|
||||||
},
|
},
|
||||||
'output': '0x' + sig.hex()
|
'output': '0x' + sig.hex()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user