From 0a429a479b86ae0ab31253944bc1582d153507db Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Sat, 8 Feb 2020 17:04:19 -0700 Subject: [PATCH] 'full_name' -> 'indentifier' for bls generators --- tests/generators/bls/main.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/generators/bls/main.py b/tests/generators/bls/main.py index 76135f282..bad4aab06 100644 --- a/tests/generators/bls/main.py +++ b/tests/generators/bls/main.py @@ -53,8 +53,8 @@ def case01_sign(): for privkey in PRIVKEYS: for message in MESSAGES: sig = bls.G2ProofOfPossession.Sign(privkey, message) - full_name = f'{int_to_hex(privkey)}_{encode_hex(message)}' - yield f'sign_case_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{int_to_hex(privkey)}_{encode_hex(message)}' + yield f'sign_case_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'privkey': int_to_hex(privkey), 'message': encode_hex(message), @@ -69,8 +69,8 @@ def case02_verify(): # Valid signature signature = bls.G2ProofOfPossession.Sign(privkey, message) pubkey = bls.G2ProofOfPossession.PrivToPub(privkey) - full_name = f'{encode_hex(pubkey)}_{encode_hex(message)}' - yield f'verify_valid_case_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{encode_hex(pubkey)}_{encode_hex(message)}' + yield f'verify_valid_case_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'pubkey': encode_hex(pubkey), 'message': encode_hex(message), @@ -81,8 +81,8 @@ def case02_verify(): # Invalid signatures -- wrong pubkey wrong_pubkey = bls.G2ProofOfPossession.PrivToPub(PRIVKEYS[(i + 1) % len(PRIVKEYS)]) - full_name = f'{encode_hex(wrong_pubkey)}_{encode_hex(message)}' - yield f'verify_wrong_pubkey_case_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{encode_hex(wrong_pubkey)}_{encode_hex(message)}' + yield f'verify_wrong_pubkey_case_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'pubkey': encode_hex(wrong_pubkey), 'message': encode_hex(message), @@ -93,8 +93,8 @@ def case02_verify(): # Invalid signature -- tampered with signature tampered_signature = signature[:-4] + b'\xFF\xFF\xFF\xFF' - full_name = f'{encode_hex(pubkey)}_{encode_hex(message)}' - yield f'verify_tampered_signature_case_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{encode_hex(pubkey)}_{encode_hex(message)}' + yield f'verify_tampered_signature_case_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'pubkey': encode_hex(pubkey), 'message': encode_hex(message), @@ -122,8 +122,8 @@ def case04_fast_aggregate_verify(): pubkeys_serial = [encode_hex(pubkey) for pubkey in pubkeys] # Valid signature - full_name = f'{pubkeys_serial}_{encode_hex(message)}' - yield f'fast_aggregate_verify_valid_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{pubkeys_serial}_{encode_hex(message)}' + yield f'fast_aggregate_verify_valid_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'pubkeys': pubkeys_serial, 'message': encode_hex(message), @@ -135,8 +135,8 @@ def case04_fast_aggregate_verify(): # Invalid signature -- extra pubkey pubkeys_extra = pubkeys + [bls.G2ProofOfPossession.PrivToPub(PRIVKEYS[-1])] pubkeys_extra_serial = [encode_hex(pubkey) for pubkey in pubkeys_extra] - full_name = f'{pubkeys_extra_serial}_{encode_hex(message)}' - yield f'fast_aggregate_verify_extra_pubkey_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{pubkeys_extra_serial}_{encode_hex(message)}' + yield f'fast_aggregate_verify_extra_pubkey_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'pubkeys': pubkeys_extra_serial, 'message': encode_hex(message), @@ -147,8 +147,8 @@ def case04_fast_aggregate_verify(): # Invalid signature -- tampered with signature tampered_signature = aggregate_signature[:-4] + b'\xff\xff\xff\xff' - full_name = f'{pubkeys_serial}_{encode_hex(message)}' - yield f'fast_aggregate_verify_tampered_signature_{(hash(bytes(full_name, "utf-8"))[:8]).hex()}', { + identifier = f'{pubkeys_serial}_{encode_hex(message)}' + yield f'fast_aggregate_verify_tampered_signature_{(hash(bytes(identifier, "utf-8"))[:8]).hex()}', { 'input': { 'pubkeys': pubkeys_serial, 'message': encode_hex(message),