Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def shamir_test(l, m, n):
s = Shamir('english')
seed = b"Shamir's Secret Sharing Scheme!"[:l] # take first l characters
shares = s.split(seed, m, n)
print('original:', seed)
print('shares:')
for i, sh in enumerate(shares):
print('%2d :' % (i + 1), sh)
shares = shares[:m] # take first m shares
cmb = s.combine(shares)
print('combined:', cmb)
if seed == cmb:
print('TEST OK')
print()
else:
print('TEST FAILED !!!')
sys.exit(1)