Package nxt.crypto
Class SimpleShamirSecretSharing
java.lang.Object
nxt.crypto.SimpleShamirSecretSharing
- All Implemented Interfaces:
SecretSharing
-
Method Summary
Modifier and TypeMethodDescriptioncombine(SecretShare[] shares, BigInteger prime) Given the needed number of shares or more, reproduce the original polynomial and extract the secret from its free term.split(BigInteger secret, int needed, int available, BigInteger prime, Random random) Given a secret, split it into "available" shares where providing "needed" shares is enough to reproduce the secret.
-
Method Details
-
split
public SecretShare[] split(BigInteger secret, int needed, int available, BigInteger prime, Random random) Given a secret, split it into "available" shares where providing "needed" shares is enough to reproduce the secret. All calculations are performed mod p, where p is a large prime number.- Specified by:
splitin interfaceSecretSharing- Parameters:
secret- the secretneeded- the number of shares needed to reproduce itavailable- the total number of sharesprime- the prime numberrandom- the random source- Returns:
- the secret shares
-