From bab018d16b446a7a534e44c7d76120a5e9039dbf Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Fri, 29 Mar 2024 10:11:17 +0000 Subject: [PATCH] reference: rename share -> secshare --- reference/simplpedpop.py | 2 +- reference/tests.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/simplpedpop.py b/reference/simplpedpop.py index 0fc2376..2de4698 100644 --- a/reference/simplpedpop.py +++ b/reference/simplpedpop.py @@ -82,7 +82,7 @@ class SignerState(NamedTuple): # TODO This should probably moved somewhere else as its common to all DKGs. # Hm, moving it to reference.py is difficult due to cylic module dependencies. class DKGOutput(NamedTuple): - share: Scalar + secshare: Scalar threshold_pubkey: GE pubshares: List[GE] diff --git a/reference/tests.py b/reference/tests.py index 3376cdd..1244abe 100644 --- a/reference/tests.py +++ b/reference/tests.py @@ -181,7 +181,7 @@ def test_correctness_internal(t, n, simulate_dkg): def test_correctness_dkg_output(t, n, dkg_outputs: List[simplpedpop.DKGOutput]): - shares = [out[0] for out in dkg_outputs] + secshares = [out[0] for out in dkg_outputs] threshold_pubkeys = [out[1] for out in dkg_outputs] signer_pubshares = [out[2] for out in dkg_outputs] @@ -196,11 +196,11 @@ def test_correctness_dkg_output(t, n, dkg_outputs: List[simplpedpop.DKGOutput]): # Check that the share corresponds to the signer_pubshare for i in range(n): - assert shares[i] * G == signer_pubshares[0][i] + assert secshares[i] * G == signer_pubshares[0][i] # Check that the first t signers (TODO: should be an arbitrary set) can # recover the threshold pubkey - recovered_secret = recover_secret(list(range(1, t + 1)), shares[0:t]) + recovered_secret = recover_secret(list(range(1, t + 1)), secshares[0:t]) assert recovered_secret * G == threshold_pubkey @@ -224,10 +224,10 @@ def test_correctness(t, n, simulate_dkg): backups = [out[1] for out in outputs] # test correctness of chilldkg_recover for i in range(n): - (share, threshold_pubkey, signer_pubshares), _ = chilldkg.signer_recover( + (secshare, threshold_pubkey, signer_pubshares), _ = chilldkg.signer_recover( seeds[i], backups[i], b"" ) - assert share == dkg_outputs[i][0] + assert secshare == dkg_outputs[i][0] assert threshold_pubkey == dkg_outputs[i][1] assert signer_pubshares == dkg_outputs[i][2]