Top Inners Fields Constructors Methods
org.bouncycastle.crypto.threshold

public Class ShamirSecretSplitter

extends Object
implements SecretSplitter
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.threshold.SecretSplitter
Imports
java.io.IOException, java.security.SecureRandom, org.bouncycastle.util.Arrays

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
protected int
l

Length of the secret

private final Polynomial
protected SecureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private byte[][]
initP(int m, int n)

public ShamirSplitSecret
resplit(byte[] secret, int
A threshold number of shares
m
,
int
Total number of shares
n
)

Implements org.bouncycastle.crypto.threshold.SecretSplitter.resplit.

Creates secret shares from a given secret.

public ShamirSplitSecret
split(int
A threshold number of shares
m
,
int
Total number of shares
n
)

Implements org.bouncycastle.crypto.threshold.SecretSplitter.split.

Creates secret shares.

public ShamirSplitSecret
splitAround(SecretShare s, int
A threshold number of shares
m
,
int
Total number of shares
n
)

Implements org.bouncycastle.crypto.threshold.SecretSplitter.splitAround.

Creates secret shares from a given secret share.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lback to summary
protected int l

Length of the secret

polyback to summary
private final Polynomial poly
randomback to summary
protected SecureRandom random

Constructor Detail

ShamirSecretSplitterback to summary
public ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, SecureRandom random)

Method Detail

initPback to summary
private byte[][] initP(int m, int n)
resplitback to summary
public ShamirSplitSecret resplit(byte[] secret, int m, int n)

Implements org.bouncycastle.crypto.threshold.SecretSplitter.resplit.

Doc from org.bouncycastle.crypto.threshold.SecretSplitter.resplit.

Creates secret shares from a given secret. The secret will be divided into shares, where the secret has a length of L bytes.

Parameters
m:int

A threshold number of shares

n:int

Total number of shares

Returns:ShamirSplitSecret

An array of byte[][] representing the generated secret shares for m users with l bytes each.

Annotations
@Override
splitback to summary
public ShamirSplitSecret split(int m, int n)

Implements org.bouncycastle.crypto.threshold.SecretSplitter.split.

Doc from org.bouncycastle.crypto.threshold.SecretSplitter.split.

Creates secret shares. The secret will be divided into shares, where the secret has a length of L bytes.

Parameters
m:int

A threshold number of shares

n:int

Total number of shares

Returns:ShamirSplitSecret

An array of byte[][] representing the generated secret shares for m users with l bytes each.

splitAroundback to summary
public ShamirSplitSecret splitAround(SecretShare s, int m, int n) throws IOException

Implements org.bouncycastle.crypto.threshold.SecretSplitter.splitAround.

Doc from org.bouncycastle.crypto.threshold.SecretSplitter.splitAround.

Creates secret shares from a given secret share. The secret will be divided into shares, where the secret has a length of L bytes.

Parameters
m:int

A threshold number of shares

n:int

Total number of shares

Returns:ShamirSplitSecret

An array of byte[][] representing the generated secret shares for m users with l bytes each.

Annotations
@Override
org.bouncycastle.crypto.threshold back to summary

public final Enum ShamirSecretSplitter.Algorithm

extends Enum<ShamirSecretSplitter.Algorithm>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ShamirSecretSplitter.Algorithm
public static final ShamirSecretSplitter.Algorithm

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ShamirSecretSplitter.Algorithm
public static ShamirSecretSplitter.Algorithm[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AESback to summary
public static final ShamirSecretSplitter.Algorithm AES
RSAback to summary
public static final ShamirSecretSplitter.Algorithm RSA

Constructor Detail

Algorithmback to summary
private Algorithm()

Method Detail

valueOfback to summary
public static ShamirSecretSplitter.Algorithm valueOf(String name)
valuesback to summary
public static ShamirSecretSplitter.Algorithm[] values()
org.bouncycastle.crypto.threshold back to summary

public final Enum ShamirSecretSplitter.Mode

extends Enum<ShamirSecretSplitter.Mode>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ShamirSecretSplitter.Mode
public static final ShamirSecretSplitter.Mode

Constructor Summary

AccessConstructor and Description
private
Mode()

Method Summary

Modifier and TypeMethod and Description
public static ShamirSecretSplitter.Mode
public static ShamirSecretSplitter.Mode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

Nativeback to summary
public static final ShamirSecretSplitter.Mode Native
Tableback to summary
public static final ShamirSecretSplitter.Mode Table

Constructor Detail

Modeback to summary
private Mode()

Method Detail

valueOfback to summary
public static ShamirSecretSplitter.Mode valueOf(String name)
valuesback to summary
public static ShamirSecretSplitter.Mode[] values()