Bouncy Castle Cryptography Library 1.81

org.bouncycastle.crypto.threshold
Class ShamirSecretSplitter

java.lang.Object
  extended byorg.bouncycastle.crypto.threshold.ShamirSecretSplitter
All Implemented Interfaces:
SecretSplitter

public class ShamirSecretSplitter
extends java.lang.Object
implements SecretSplitter


Nested Class Summary
static class ShamirSecretSplitter.Algorithm
           
static class ShamirSecretSplitter.Mode
           
 
Field Summary
protected  int l
          Length of the secret
protected  java.security.SecureRandom random
           
 
Constructor Summary
ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm, ShamirSecretSplitter.Mode mode, int l, java.security.SecureRandom random)
           
 
Method Summary
 SplitSecret resplit(byte[] secret, int m, int n)
          Creates secret shares from a given secret.
 SplitSecret split(int m, int n)
          Creates secret shares.
 SplitSecret splitAround(SecretShare s, int m, int n)
          Creates secret shares from a given secret share.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

l

protected int l
Length of the secret


random

protected java.security.SecureRandom random
Constructor Detail

ShamirSecretSplitter

public ShamirSecretSplitter(ShamirSecretSplitter.Algorithm algorithm,
                            ShamirSecretSplitter.Mode mode,
                            int l,
                            java.security.SecureRandom random)
Method Detail

split

public SplitSecret split(int m,
                         int n)
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 interface SecretSplitter
Parameters:
m - A threshold number of shares
n - Total number of shares
Returns:
An array of representing the generated secret shares for m users with l bytes each.

splitAround

public SplitSecret splitAround(SecretShare s,
                               int m,
                               int n)
                        throws java.io.IOException
Description copied from interface: SecretSplitter
Creates secret shares from a given secret share. The secret will be divided into shares, where the secret has a length of L bytes.

Specified by:
splitAround in interface SecretSplitter
Parameters:
m - A threshold number of shares
n - Total number of shares
Returns:
An array of representing the generated secret shares for m users with l bytes each.
Throws:
java.io.IOException

resplit

public SplitSecret resplit(byte[] secret,
                           int m,
                           int n)
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 interface SecretSplitter
Parameters:
m - A threshold number of shares
n - Total number of shares
Returns:
An array of representing the generated secret shares for m users with l bytes each.

Bouncy Castle Cryptography Library 1.81