C# Class MpcLib.SecretSharing.BigShamirSharing

Implemenets the threshold secret sharing scheme based on Adi Shamir's method on BigIntegers.
Exibir arquivo Open project: mahdiz/mpclib Class Usage Examples

Public Methods

Method Description
GenerateCommitment ( int numShares, BigZp coeffs, System.Numerics.BigInteger prime, MG &witnesses, PolyCommit polyCommit ) : MG
Recombine ( IList sharedSecrets, int polyDeg, System.Numerics.BigInteger prime ) : BigZp
Recombine ( IList sharedSecrets, int polyDeg, System.Numerics.BigInteger prime, bool usePrimitiveRecombine ) : BigZp

Recombines (interpolate) the secret from secret shares.

Share ( BigZp secret, int numPlayers, int polyDeg ) : IList

Calculates the shares of a secret with polynomial of degree t and numPlayers players.

Share ( BigZp secret, int numPlayers, int polyDeg, IList &coeffs ) : IList

Calculates the shares of a secret with polynomial of degree t and numPlayers players. The method also returns the array of coefficients of the polynomial.

Private Methods

Method Description
Share ( BigZp secret, int numPlayers, int polyDeg, bool usePrimitiveShare, IList &coeffs ) : IList

Evaluates the shares of secret with polynomial of degree 'polynomDeg' and 'numPlayers' players.

SimpleRecombine ( IList sharedSecrets, int polyDeg, System.Numerics.BigInteger prime ) : BigZp
TruncateVector ( BigZp vector, int toSize ) : BigZp[]

Method Details

GenerateCommitment() public static method

public static GenerateCommitment ( int numShares, BigZp coeffs, System.Numerics.BigInteger prime, MG &witnesses, PolyCommit polyCommit ) : MG
numShares int
coeffs BigZp
prime System.Numerics.BigInteger
witnesses MG
polyCommit PolyCommit
return MG

Recombine() public static method

public static Recombine ( IList sharedSecrets, int polyDeg, System.Numerics.BigInteger prime ) : BigZp
sharedSecrets IList
polyDeg int
prime System.Numerics.BigInteger
return BigZp

Recombine() public static method

Recombines (interpolate) the secret from secret shares.
public static Recombine ( IList sharedSecrets, int polyDeg, System.Numerics.BigInteger prime, bool usePrimitiveRecombine ) : BigZp
sharedSecrets IList
polyDeg int
prime System.Numerics.BigInteger
usePrimitiveRecombine bool
return BigZp

Share() public static method

Calculates the shares of a secret with polynomial of degree t and numPlayers players.
public static Share ( BigZp secret, int numPlayers, int polyDeg ) : IList
secret BigZp
numPlayers int
polyDeg int
return IList

Share() public static method

Calculates the shares of a secret with polynomial of degree t and numPlayers players. The method also returns the array of coefficients of the polynomial.
public static Share ( BigZp secret, int numPlayers, int polyDeg, IList &coeffs ) : IList
secret BigZp
numPlayers int
polyDeg int
coeffs IList
return IList