fix BLS tests name length

This commit is contained in:
protolambda 2019-09-08 14:36:09 -04:00
parent db34ee17b6
commit 28da0a07b8
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,12 @@ from eth_utils import (
from gen_base import gen_runner, gen_typing
from py_ecc import bls
from hashlib import sha256
def hash(x):
return sha256(x).digest()
F2Q_COEFF_LEN = 48
G2_COMPRESSED_Z_LEN = 48
@ -122,7 +128,8 @@ def case04_sign_messages():
for message in MESSAGES:
for domain in DOMAINS:
sig = bls.sign(message, privkey, domain)
yield f'sign_msg_{int_to_hex(privkey)}_{encode_hex(message)}_{encode_hex(domain)}', {
full_name = f'{int_to_hex(privkey)}_{encode_hex(message)}_{encode_hex(domain)}'
yield f'sign_msg_case_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', {
'input': {
'privkey': int_to_hex(privkey),
'message': encode_hex(message),