org.bouncycastle.crypto.threshold
Class ShamirSplitSecret
java.lang.Object
org.bouncycastle.crypto.threshold.ShamirSplitSecret
- All Implemented Interfaces:
- SplitSecret
- public class ShamirSplitSecret
- extends java.lang.Object
- implements SplitSecret
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShamirSplitSecret
public ShamirSplitSecret(ShamirSecretSplitter.Algorithm algorithm,
ShamirSecretSplitter.Mode mode,
ShamirSplitSecretShare[] secretShares)
- Deprecated. the mode is ignored - see
ShamirSecretSplitter.Mode. Use
getInstance(ShamirSecretSplitter.Algorithm, ShamirSplitSecretShare[]).
getInstance
public static ShamirSplitSecret getInstance(ShamirSecretSplitter.Algorithm algorithm,
ShamirSplitSecretShare[] secretShares)
- Recombine a set of shares using constant-time GF(256) arithmetic.
- Parameters:
algorithm - the reduction polynomial the shares were produced over.secretShares - the shares to recombine.
getSecretShares
public SecretShare[] getSecretShares()
- Specified by:
getSecretShares in interface SplitSecret
multiple
public ShamirSplitSecret multiple(int mul)
throws java.io.IOException
- Throws:
java.io.IOException
divide
public ShamirSplitSecret divide(int div)
throws java.io.IOException
- Throws:
java.io.IOException
getSecret
public byte[] getSecret()
throws java.io.IOException
- Description copied from interface:
SplitSecret
- Recombines secret shares to reconstruct the original secret.
- Specified by:
getSecret in interface SplitSecret
- Returns:
- A byte array containing the reconstructed secret.
- Throws:
java.io.IOException