C# Класс MpcLib.SecretSharing.ShamirSharing

Implemenets the threshold secret sharing scheme based on Adi Shamir's method.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CalculateRandomShare ( Zp myShare, IList polyUpdate ) : Zp

The i-th user gets a Qj(i) List from users, each user j calculated Qj(i) - the j element in the List

CheckSharedSecrets ( Zp secret, int numberOfPlayers, int polynomDeg, int prime ) : bool
DetailedShare ( Zp secret, int numPlayers, int polynomDeg ) : ShareDetails

Evaluates the shared secrets of secret with polynom of degree t and numberOfPlayers players.

GetRandomizedShares ( int numPlayers, int polynomDeg, int prime ) : IList

Creates a random poynomial Qj(x), for the j player, and creates a list of elements, such that the i-th element is Qj(i)

GetRandomizedSharesByzantineCase ( int numPlayers, int polynomDeg, int prime ) : IList

Creates a random poynomial Qj(x) ,for the j player,and creates a list of elements, such that the i-th element is Qj(i)

PrimitiveShare ( Zp secret, int numPlayers, int polynomDeg ) : IList
Recombine ( IList sharedSecrets, int polynomDeg, int prime ) : Zp
Recombine ( IList sharedSecrets, int polyDeg, int prime, bool usePrimitiveRecombine ) : Zp

Recombines (interpolate) the secret from secret shares.

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

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

Share ( Zp 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.

SimpleRecombine ( IList sharedSecrets, int polyDeg, int prime ) : Zp

Приватные методы

Метод Описание
Share ( Zp secret, int numPlayers, int polynomDeg, bool usePrimitiveShare, IList &coeffs ) : IList

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

TruncateVector ( Zp vector, int toSize ) : Zp[]

Описание методов

CalculateRandomShare() публичный статический Метод

The i-th user gets a Qj(i) List from users, each user j calculated Qj(i) - the j element in the List
public static CalculateRandomShare ( Zp myShare, IList polyUpdate ) : Zp
myShare Zp
polyUpdate IList
Результат Zp

CheckSharedSecrets() публичный статический Метод

public static CheckSharedSecrets ( Zp secret, int numberOfPlayers, int polynomDeg, int prime ) : bool
secret Zp
numberOfPlayers int
polynomDeg int
prime int
Результат bool

DetailedShare() публичный статический Метод

Evaluates the shared secrets of secret with polynom of degree t and numberOfPlayers players.
public static DetailedShare ( Zp secret, int numPlayers, int polynomDeg ) : ShareDetails
secret Zp
numPlayers int
polynomDeg int
Результат ShareDetails

GetRandomizedShares() публичный статический Метод

Creates a random poynomial Qj(x), for the j player, and creates a list of elements, such that the i-th element is Qj(i)
public static GetRandomizedShares ( int numPlayers, int polynomDeg, int prime ) : IList
numPlayers int
polynomDeg int
prime int
Результат IList

GetRandomizedSharesByzantineCase() публичный статический Метод

Creates a random poynomial Qj(x) ,for the j player,and creates a list of elements, such that the i-th element is Qj(i)
public static GetRandomizedSharesByzantineCase ( int numPlayers, int polynomDeg, int prime ) : IList
numPlayers int
polynomDeg int
prime int
Результат IList

PrimitiveShare() публичный статический Метод

public static PrimitiveShare ( Zp secret, int numPlayers, int polynomDeg ) : IList
secret Zp
numPlayers int
polynomDeg int
Результат IList

Recombine() публичный статический Метод

public static Recombine ( IList sharedSecrets, int polynomDeg, int prime ) : Zp
sharedSecrets IList
polynomDeg int
prime int
Результат Zp

Recombine() публичный статический Метод

Recombines (interpolate) the secret from secret shares.
public static Recombine ( IList sharedSecrets, int polyDeg, int prime, bool usePrimitiveRecombine ) : Zp
sharedSecrets IList
polyDeg int
prime int
usePrimitiveRecombine bool
Результат Zp

Share() публичный статический Метод

Calculates the shares of a secret with polynomial of degree t and numPlayers players.
public static Share ( Zp secret, int numPlayers, int polyDeg ) : IList
secret Zp
numPlayers int
polyDeg int
Результат IList

Share() публичный статический Метод

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 ( Zp secret, int numPlayers, int polyDeg, IList &coeffs ) : IList
secret Zp
numPlayers int
polyDeg int
coeffs IList
Результат IList

SimpleRecombine() публичный статический Метод

public static SimpleRecombine ( IList sharedSecrets, int polyDeg, int prime ) : Zp
sharedSecrets IList
polyDeg int
prime int
Результат Zp