Class ShamirSecretSplitter
java.lang.Object
org.bouncycastle.crypto.threshold.ShamirSecretSplitter
- All Implemented Interfaces:
SecretSplitter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionShamirSecretSplitter
(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, SecureRandom random) -
Method Summary
Modifier and TypeMethodDescriptionresplit
(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
public ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, SecureRandom random)
-
-
Method Details
-
split
Description copied from interface:SecretSplitter
Creates secret shares. The secret will be divided into shares, where the secret has a length of L bytes.- Specified by:
split
in interfaceSecretSplitter
- Parameters:
m
- A threshold number of sharesn
- Total number of shares- Returns:
- An array of
byte[][]
representing the generated secret shares for m users with l bytes each.
-
resplit
Description copied from interface:SecretSplitter
Creates secret shares from a given secret. The secret will be divided into shares, where the secret has a length of L bytes.- Specified by:
resplit
in interfaceSecretSplitter
- Parameters:
m
- A threshold number of sharesn
- Total number of shares- Returns:
- An array of
byte[][]
representing the generated secret shares for m users with l bytes each.
-