shamir.shamir_secret_sharing_integers module
Utility for Shamir secret sharing over the integers.
Bases:
object
Class that keeps track of the shares for a certain value that is secret shared over the integers.
Add the shares belonging to the two given IntegerShares values together.
- Parameters:
other (
IntegerShares
) – Shares to be added to these shares.- Raises:
ValueError – In case a different secret sharing scheme was used.
- Return type:
- Returns:
New IntegerShares object where the shares have been added together.
Multiply the shares belonging to the two given IntegerShares values together. Only possible when both schemes are the same.
- Parameters:
other (
IntegerShares
) – Shares to be multiplied with these shares.- Return type:
- Returns:
New IntegerShares object where the shares have been multiplied together.
Multiply the shares belonging to this value with a given scalar integer or ShamirShares object.
- Parameters:
other (
Any
) – ShamirShares or scalar to be multiplied with these shares.- Return type:
Any
- Returns:
New IntegerShares object where the shares have been multiplied together.
Function that uses the shares from other parties to reconstruct the secret
- Parameters:
modulus (
int
) – the modulus to use- Raises:
ValueError – In case not enough shares are present to reconstruct the secret.
- Return type:
int
- Returns:
original secret
Serialization function
- Return type:
Dict
[str
,Union
[int
,Dict
[int
,int
],Dict
[str
,int
],Dict
[str
,Dict
[str
,int
]]]]- Returns:
json object containing the necessary information to deserialize
- class shamir.shamir_secret_sharing_integers.ShamirSecretSharingIntegers(kappa=40, max_int=5, number_of_parties=10, polynomial_degree=4)[source]
Bases:
object
Class with Shamir Secret sharing functionality over the integers
- __init__(kappa=40, max_int=5, number_of_parties=10, polynomial_degree=4)[source]
Initialize a secret sharing over the integers
- Parameters:
kappa (
int
) – statistical security parametermax_int (
int
) – Value that together with kappa and number_of_parties determines the interval from which polynomial coefficients are randomly sampled. In general, the Paillier modulus is used for max.number_of_parties (
int
) – number of shares that need to be created for each sharingpolynomial_degree (
int
) – degree of polynomials used to share secrets
- serialize()[source]
Serialization function
- Return type:
Dict
[str
,int
]- Returns:
json object containing the necessary information to deserialize
Function that creates shares of a value for each party
- Parameters:
secret (
int
) – secret to be shared- Return type:
- Returns:
sharing of the secret
Bases:
object
Shares contains all shares of this party. Every subclass contains an object for that element, such as \(p\) or \(q\). These objects contain up to two entries: “additive” and “shares”, in “additive”, the local additive share of that element is stored, in “shares”, the shamir shares of the local additive share are stored.
Bases:
object
Shares of \(\beta\).
Bases:
object
Shares of the used biprime.
Bases:
object
Shares of \(\lambda\).
Bases:
object
Shares of \(n\).
Bases:
object
Shares of \(p\).
Bases:
object
Partial decryption containing shares of at least this party.
Bases:
object
Shares of \(q\).
Bases:
object
Shares of the secret key.
Bases:
object
Shares of \(v\).