:orphan: :py:mod:`ggmpc.shamir` ====================== .. py:module:: ggmpc.shamir Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: ggmpc.shamir.split ggmpc.shamir.combine .. py:function:: split(curve, s, t, n=None, I=None) Perform Shamir sharing on the secret `s` to the degree `t - 1` split `n` ways. The split secret requires `t` shares to be reconstructed. :param s: Secret to split. :type s: int :param t: Share threshold required to reconstruct secret. :type t: int :param n: Total number of shares to split secret into. :type n: int, optional :param I: Indices used for each party. Defaults to range(1, 1 + n). :type I: list, optional :return: Dictionary of shares. Each key is an int in the range 1<=x<=n representing that share's free term. :rtype dict: .. py:function:: combine(curve, shares) Reconstitute a secret from a dictionary of shares. The number of shares must be equal to `t` to reconstitute the original secret. :param shares: Dictionary of shares. Each key is the free term of the share. :type shares: dict :return: Reconstituted secret. :rtype: int