ggmpc.shamir

Module Contents

Functions

split(curve, s, t[, n, I])

Perform Shamir sharing on the secret s to the degree t - 1 split n

combine(curve, shares)

Reconstitute a secret from a dictionary of shares. The number of shares must

ggmpc.shamir.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.

Parameters:
  • s (int) – Secret to split.

  • t (int) – Share threshold required to reconstruct secret.

  • n (int, optional) – Total number of shares to split secret into.

  • I (list, optional) – Indices used for each party. Defaults to range(1, 1 + n).

Returns:

Dictionary of shares. Each key is an int in the range 1<=x<=n representing that share’s free term.

Rtype dict:

ggmpc.shamir.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.

Parameters:

shares (dict) – Dictionary of shares. Each key is the free term of the share.

Returns:

Reconstituted secret.

Return type:

int