public final class SimpleShamirSecretSharing extends java.lang.Object implements SecretSharing
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
combine(SecretShare[] shares,
java.math.BigInteger prime)
Given the needed number of shares or more, reproduce the original polynomial and extract the secret from its free
term.
|
SecretShare[] |
split(java.math.BigInteger secret,
int needed,
int available,
java.math.BigInteger prime,
java.util.Random random)
Given a secret, split it into "available" shares where providing "needed" shares is enough to reproduce the secret.
|
public SecretShare[] split(java.math.BigInteger secret, int needed, int available, java.math.BigInteger prime, java.util.Random random)
split
in interface SecretSharing
secret
- the secretneeded
- the number of shares needed to reproduce itavailable
- the total number of sharesprime
- the prime numberrandom
- the random sourcepublic java.math.BigInteger combine(SecretShare[] shares, java.math.BigInteger prime)
combine
in interface SecretSharing
shares
- the shares represention points over the polynomialprime
- the prime number