public class ShamirSecretSplitter extends java.lang.Object implements SecretSplitter
| Modifier and Type | Class and Description |
|---|---|
static class |
ShamirSecretSplitter.Algorithm |
static class |
ShamirSecretSplitter.Mode
Deprecated.
no longer selects anything. Mode.Table indexed log/exp tables with the secret being
split and with the share bytes, so which cache line it touched revealed them; both values now
use the same constant-time arithmetic. Use
getInstance(Algorithm, int, SecureRandom),
which takes no 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)
Deprecated.
the mode is ignored - see
ShamirSecretSplitter.Mode. Use
getInstance(Algorithm, int, SecureRandom). |
| Modifier and Type | Method and Description |
|---|---|
static ShamirSecretSplitter |
getInstance(ShamirSecretSplitter.Algorithm algorithm,
int l,
java.security.SecureRandom random)
Create a splitter using constant-time GF(256) arithmetic.
|
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
@Deprecated public ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, java.security.SecureRandom random)
ShamirSecretSplitter.Mode. Use
getInstance(Algorithm, int, SecureRandom).public static ShamirSecretSplitter getInstance(ShamirSecretSplitter.Algorithm algorithm, int l, java.security.SecureRandom random)
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.public ShamirSplitSecret split(int m, int n)
SecretSplittersplit in interface SecretSplitterm - A threshold number of sharesn - Total number of sharespublic ShamirSplitSecret splitAround(SecretShare s, int m, int n) throws java.io.IOException
SecretSplittersplitAround in interface SecretSplitterm - A threshold number of sharesn - Total number of sharesjava.io.IOExceptionpublic ShamirSplitSecret resplit(byte[] secret, int m, int n)
SecretSplitterresplit in interface SecretSplitterm - A threshold number of sharesn - Total number of shares