#2 new task

Unable to reconstruct shares — at Version 1

Reported by: zonamroza@… Owned by:
Priority: trivial Milestone:
Version: Keywords: Shares reconstruction
Cc:

Description (last modified by Laman)

Have been trying to use the library and created shares of a 32-bytes key as follows:
shares = generate_raw(encoded_public_key, 3, 5)

When reconstructing using - reconstruct_raw(shares) - getting the following error:

  key = reconstruct_raw(shares)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/shamira/core.py", line 49, in reconstruct_raw
    if len({x for (x, _) in shares}) < len(shares):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/shamira/core.py", line 49, in <setcomp>
    if len({x for (x, _) in shares}) < len(shares):
ValueError: too many values to unpack (expected 2)

Also tried:

shares = generate(encoded_public_key, 3, 5)
key = reconstruct(shares, encoding="b32", raw=False)

But the following error appears:

key = reconstruct(shares, encoding="b32", raw=False)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/shamira/core.py", line 95, in reconstruct
    bs = reconstruct_raw(*(decode(s, encoding) for s in shares))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/shamira/core.py", line 95, in <genexpr>
    bs = reconstruct_raw(*(decode(s, encoding) for s in shares))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/shamira/core.py", line 112, in decode
    (*_, i, share_str) = share.split(".")
AttributeError: 'list' object has no attribute 'split'

Not completely sure whether I implement it incorrectly or something is wrong. But would appreciate some guidance on the issue.

Change History (1)

comment:1 by Laman, on 04/09/2022 at 08:51:21 AM

Description: modified (diff)
Note: See TracTickets for help on using tickets.