public class ShamirSecretSplitter extends java.lang.Object implements SecretSplitter
| Modifier and Type | Class and Description |
|---|---|
static class |
ShamirSecretSplitter.Algorithm |
static class |
ShamirSecretSplitter.Mode |
| Modifier and Type | Field and Description |
|---|---|
protected int |
l
Length of the secret
|
protected java.security.SecureRandom |
random |
| Constructor and Description |
|---|
ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm,
ShamirSecretSplitter.Mode mode,
int l,
java.security.SecureRandom random) |
| Modifier and Type | Method and Description |
|---|---|
ShamirSplitSecret |
resplit(byte[] secret,
int m,
int n)
Creates secret shares from a given secret.
|
ShamirSplitSecret |
split(int m,
int n)
Creates secret shares.
|
ShamirSplitSecret |
splitAround(SecretShare s,
int m,
int n)
Creates secret shares from a given secret share.
|
protected int l
protected java.security.SecureRandom random
public ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, java.security.SecureRandom random)
public ShamirSplitSecret split(int m, int n)
SecretSplittersplit in interface SecretSplitterm - A threshold number of sharesn - Total number of sharesbyte[][] representing the generated secret shares for m users with l bytes each.public ShamirSplitSecret splitAround(SecretShare s, int m, int n) throws java.io.IOException
SecretSplittersplitAround in interface SecretSplitterm - A threshold number of sharesn - Total number of sharesbyte[][] representing the generated secret shares for m users with l bytes each.java.io.IOExceptionpublic ShamirSplitSecret resplit(byte[] secret, int m, int n)
SecretSplitterresplit in interface SecretSplitterm - A threshold number of sharesn - Total number of sharesbyte[][] representing the generated secret shares for m users with l bytes each.