diff --git a/src/condensed.py b/src/condensed.py --- a/src/condensed.py +++ b/src/condensed.py @@ -58,7 +58,7 @@ class SException(Exception): pass def reconstruct_raw(*shares): """Tries to recover the secret from its shares. - :param shares: ((i, (bytes) share), ...) + :param shares: (((int) i, (bytes) share), ...) :return: (bytes) reconstructed secret. Too few shares returns garbage.""" secret_len = len(shares[0][1]) res = [None]*secret_len @@ -83,7 +83,7 @@ def reconstruct(*shares): def decode(share): try: - (i, _, share_str) = share.partition(".") + (*_, i, share_str) = share.split(".") i = int(i) if not 1<=i<=255: raise SException("Malformed share: Failed 1<=k<=255, k={0}".format(i))