Package nxt.crypto

Class SimpleShamirSecretSharing

java.lang.Object
nxt.crypto.SimpleShamirSecretSharing
All Implemented Interfaces:
SecretSharing

public final class SimpleShamirSecretSharing extends Object implements SecretSharing
  • Method Details

    • split

      public SecretShare[] split(BigInteger secret, int needed, int available, BigInteger prime, Random random)
      Given a secret, split it into "available" shares where providing "needed" shares is enough to reproduce the secret. All calculations are performed mod p, where p is a large prime number.
      Specified by:
      split in interface SecretSharing
      Parameters:
      secret - the secret
      needed - the number of shares needed to reproduce it
      available - the total number of shares
      prime - the prime number
      random - the random source
      Returns:
      the secret shares
    • combine

      public BigInteger combine(SecretShare[] shares, BigInteger prime)
      Given the needed number of shares or more, reproduce the original polynomial and extract the secret from its free term. All calculations are performed mod p, where p is a large prime number
      Specified by:
      combine in interface SecretSharing
      Parameters:
      shares - the shares represention points over the polynomial
      prime - the prime number
      Returns:
      the original secret reproduced from the free term of the polynomial which passes through these points