ethereum / consensus-spec-tests

Common tests for the Ethereum proof-of-stake consensus layer
MIT License
75 stars 24 forks source link

Non-updated BLS test #18

Closed mratsim closed 4 years ago

mratsim commented 4 years ago

The test bls/sign/small/sign_case_11b8c7cad5238946 is still using the hash-to-curve draft v5 output

PyECC outputs 0x89dcc02150631de23c5ba6fac74394163f1f05643c77e0bde7fea29ce64cf5fe68c440ff401908d81cc3ddcd46db41cf119e6ab5f897cafdb9b78000437354ea9796b61badc28e6d757e42c0dd7e55bd5b4fd4d9a694ddbddb5f524511090277 for the following test: https://media.githubusercontent.com/media/ethereum/eth2.0-spec-tests/master/tests/general/phase0/bls/sign/small/sign_case_11b8c7cad5238946/data.yaml

input: {privkey: '0x47b8192d77bf871b62e87859d653922725724a5c031afeabc60bcef5ff665138',
  message: '0x0000000000000000000000000000000000000000000000000000000000000000'}
output: '0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9'
from py_ecc import bls

privkey = int('0x47b8192d77bf871b62e87859d653922725724a5c031afeabc60bcef5ff665138', 16)
message = bytes.fromhex('0000000000000000000000000000000000000000000000000000000000000000')

sig = bls.G2ProofOfPossession.Sign(privkey, message)
print(f'output: 0x{sig.hex()}')

What is in the test is the value expected in the previous hash-to-curve draft

mratsim commented 4 years ago

Oops my fault, I had both folders side-by-side and named the wrong one 0.12 and the other 0.10 ...