de.christofreichardt.scala.shamir

Contains the core classes needed for sharing or merging of secrets.

Attributes

See also

Members list

Type members

Classlikes

class NewtonInterpolation(val supportingPoints: IndexedSeq[(BigInt, BigInt)], val prime: BigInt) extends Tracing

Implements Newtons interpolation algorithm. All calculations will be carried out by finite field algebra.

Implements Newtons interpolation algorithm. All calculations will be carried out by finite field algebra.

Value parameters

prime

a prime number

supportingPoints

some pairwise different supporting points

Attributes

Constructor

Creates a new NewtonInterpolation by applying some supporting points and a prime number.

Supertypes
trait Tracing
class Object
trait Matchable
class Any
class NewtonPolynomial(val degree: Int, val basis: IndexedSeq[BigInt], val coefficients: IndexedSeq[BigInt], val prime: BigInt) extends Tracing

Defines a Newton Polynomial.

Defines a Newton Polynomial.

Value parameters

basis

the Newton basis polynomials

coefficients

The Newton coefficients

degree

the degree of the polynomial

prime

the prime modulus

Attributes

Constructor

Creates an instance of a Newton Polynomial suitable for calculations using finite field algebra.

Supertypes
trait Tracing
class Object
trait Matchable
class Any
class Polynomial(val coefficients: IndexedSeq[BigInt], val prime: BigInt) extends Tracing

Defines a polynomial in its canonical form.

Defines a polynomial in its canonical form.

Value parameters

coefficients

the polynoms coefficients

prime

the prime modulus

Attributes

Supertypes
trait Tracing
class Object
trait Matchable
class Any
class SecretMerging(val sharePoints: IndexedSeq[(BigInt, BigInt)], val prime: BigInt) extends Tracing

Recovers the original secret bytes by combining the given shares.

Recovers the original secret bytes by combining the given shares.

Value parameters

prime

the prime modulus

sharePoints

the shares

Attributes

Constructor

Creates a immutable SecretMerging instance.

Companion
object
Supertypes
trait Tracing
class Object
trait Matchable
class Any
object SecretMerging

This object provides some operations to create SecretMerging instances.

This object provides some operations to create SecretMerging instances.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class SecretSharing(val shares: Int, val threshold: Int, val secretBytes: IndexedSeq[Byte], val random: SecureRandom) extends Tracing

A secret sharing sheme.

A secret sharing sheme.

Value parameters

random

the secure random source

secretBytes

the actual secret

shares

the number of shares

threshold

the number of shares required for the recovery of the secret bytes

Attributes

Constructor

Creates a new SecretSharing sheme with shares, threshold, secretBytes and a secure random source.

Supertypes
trait Tracing
class Object
trait Matchable
class Any

Value members

Concrete methods

def bigIntToBytes(s: BigInt): IndexedSeq[Byte]

Converts the given BigInt number into bytes by discarding the leading byte.

Converts the given BigInt number into bytes by discarding the leading byte.

Value parameters

s

the to be converted BigInt number

Attributes

Returns

the resulting bytes

def bytes2BigInt(bytes: IndexedSeq[Byte]): BigInt

Converts the given bytes into a non-negative BigInt number by padding 0x7F upfront.

Converts the given bytes into a non-negative BigInt number by padding 0x7F upfront.

Value parameters

bytes

the to be converted bytes

Attributes

Returns

the resulting non-negative BigInt number

def charSequenceToByteArray(charSequence: CharSequence): Array[Byte]

Encodes a given character sequence as bytes ba applying UTF-8 encoding.

Encodes a given character sequence as bytes ba applying UTF-8 encoding.

Value parameters

charSequence

the to be encoded characters

Attributes

Returns

the encoded character sequence

def pairWiseDifferent[T](items: Iterable[T]): Boolean

Checks if any two items within the Iterable are identical.

Checks if any two items within the Iterable are identical.

Value parameters

items

an Iterable of some items

Attributes

Returns

true if no pair of identical items has been found

Concrete fields

val CERTAINTY: Int

defines the certainty of a number being prime, that is between 2^64 primes computed by the underlying algorithm there is one false positive.

defines the certainty of a number being prime, that is between 2^64 primes computed by the underlying algorithm there is one false positive.

Attributes

val PADDING_BYTE: Byte