Class ShamirSplitSecret
- java.lang.Object
-
- org.bouncycastle.crypto.threshold.ShamirSplitSecret
-
- All Implemented Interfaces:
SplitSecret
public class ShamirSplitSecret extends java.lang.Object implements SplitSecret
-
-
Constructor Summary
Constructors Constructor Description ShamirSplitSecret(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, ShamirSplitSecretShare[] secretShares)Deprecated.the mode is ignored - seeShamirSecretSplitter.Mode.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ShamirSplitSecretdivide(int div)static ShamirSplitSecretgetInstance(ShamirSecretSplitter.Algorithm algorithm, ShamirSplitSecretShare[] secretShares)Recombine a set of shares using constant-time GF(256) arithmetic.byte[]getSecret()Recombines secret shares to reconstruct the original secret.ShamirSplitSecretShare[]getSecretShares()ShamirSplitSecretmultiple(int mul)
-
-
-
Constructor Detail
-
ShamirSplitSecret
@Deprecated public ShamirSplitSecret(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, ShamirSplitSecretShare[] secretShares)
Deprecated.the mode is ignored - seeShamirSecretSplitter.Mode. UsegetInstance(ShamirSecretSplitter.Algorithm, ShamirSplitSecretShare[]).
-
-
Method Detail
-
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 ShamirSplitSecretShare[] getSecretShares()
- Specified by:
getSecretSharesin interfaceSplitSecret
-
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.IOExceptionDescription copied from interface:SplitSecretRecombines secret shares to reconstruct the original secret.- Specified by:
getSecretin interfaceSplitSecret- Returns:
- A byte array containing the reconstructed secret.
- Throws:
java.io.IOException
-
-