Class ShamirSecretSplitter

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

public class ShamirSecretSplitter extends Object implements SecretSplitter
  • Field Details

    • l

      protected int l
      Length of the secret
    • random

      protected SecureRandom random
  • Constructor Details

  • Method Details

    • split

      public ShamirSplitSecret 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 byte[][] representing the generated secret shares for m users with l bytes each.
    • splitAround

      public ShamirSplitSecret splitAround(SecretShare s, int m, int n) throws 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 byte[][] representing the generated secret shares for m users with l bytes each.
      Throws:
      IOException
    • resplit

      public ShamirSplitSecret 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 byte[][] representing the generated secret shares for m users with l bytes each.