1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-17 11:58:13 +00:00
trezor-firmware/mocks/trezor/crypto/ssss.py

13 lines
358 B
Python
Raw Normal View History

2016-09-27 14:48:21 +00:00
2017-04-08 16:43:26 +00:00
# extmod/modtrezorcrypto/modtrezorcrypto-ssss.h
2016-09-27 14:48:21 +00:00
def split(m: int, n: int, secret: bytes) -> tuple:
'''
Split secret to (M of N) shares using Shamir's Secret Sharing Scheme
'''
2017-04-08 16:43:26 +00:00
# extmod/modtrezorcrypto/modtrezorcrypto-ssss.h
2016-09-27 14:48:21 +00:00
def combine(shares: tuple) -> bytes:
'''
Combine M shares of Shamir's Secret Sharing Scheme into secret
'''