Class ShamirSecretSplitter
java.lang.Object
org.bouncycastle.crypto.threshold.ShamirSecretSplitter
- All Implemented Interfaces:
SecretSplitter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumDeprecated.no longer selects anything. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, SecureRandom random) Deprecated.the mode is ignored - seeShamirSecretSplitter.Mode. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShamirSecretSplittergetInstance(ShamirSecretSplitter.Algorithm algorithm, int l, SecureRandom random) Create a splitter using constant-time GF(256) arithmetic.resplit(byte[] secret, int m, int n) Creates secret shares from a given secret.split(int m, int n) Creates secret shares.splitAround(SecretShare s, int m, int n) Creates secret shares from a given secret share.
-
Field Details
-
l
protected int lLength of the secret -
random
-
-
Constructor Details
-
ShamirSecretSplitter
@Deprecated public ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, SecureRandom random) Deprecated.the mode is ignored - seeShamirSecretSplitter.Mode. UsegetInstance(Algorithm, int, SecureRandom).
-
-
Method Details
-
getInstance
public static ShamirSecretSplitter getInstance(ShamirSecretSplitter.Algorithm algorithm, int l, SecureRandom random) Create a splitter using constant-time GF(256) arithmetic.- Parameters:
algorithm- the reduction polynomial to work over.l- length in bytes of the secret to be split.random- source of randomness for the polynomial coefficients.
-
split
Description copied from interface:SecretSplitterCreates secret shares. The secret will be divided into shares, where the secret has a length of L bytes.- Specified by:
splitin interfaceSecretSplitter- Parameters:
m- A threshold number of sharesn- Total number of shares- Returns:
- the n generated secret shares, each L bytes long, any m of which recover the secret.
-
resplit
Description copied from interface:SecretSplitterCreates secret shares from a given secret. The secret will be divided into shares, where the secret has a length of L bytes.- Specified by:
resplitin interfaceSecretSplitter- Parameters:
m- A threshold number of sharesn- Total number of shares- Returns:
- the n generated secret shares, each L bytes long, any m of which recover the secret.
-