class SecretSharing extends Tracing
A secret sharing sheme.
- Alphabetic
- By Inheritance
- SecretSharing
- Tracing
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SecretSharing(shares: Int, threshold: Int, password: CharSequence)
Creates a new SecretSharing sheme with shares, threshold, password and a default secure random source.
Creates a new SecretSharing sheme with shares, threshold, password and a default secure random source.
- shares
the number of shares
- threshold
the number of shares required for the recovery of the secret bytes
- password
the actual secret, will be encoded with UTF-8
- new SecretSharing(shares: Int, threshold: Int, secretBytes: Array[Byte])
Creates a new SecretSharing sheme with shares, threshold, secretBytes and a default secure random source.
Creates a new SecretSharing sheme with shares, threshold, secretBytes and a default secure random source. This is convenient when calling from Java.
- shares
the number of shares
- threshold
the number of shares required for the recovery of the secret bytes
- secretBytes
the actual secret
- new SecretSharing(shares: Int, threshold: Int, secretBytes: IndexedSeq[Byte])
Creates a new SecretSharing sheme with shares, threshold, secretBytes and a default secure random source.
Creates a new SecretSharing sheme with shares, threshold, secretBytes and a default secure random source.
- shares
the number of shares
- threshold
the number of shares required for the recovery of the secret bytes
- secretBytes
the actual secret
- new SecretSharing(secretBytes: IndexedSeq[Byte])
Creates a new SecretSharing sheme with 6 shares, threshold == 3, the given secretBytes and a default secure random source.
Creates a new SecretSharing sheme with 6 shares, threshold == 3, the given secretBytes and a default secure random source.
- secretBytes
the actual secret
- new SecretSharing(shares: Int, threshold: Int, secretBytes: IndexedSeq[Byte], random: SecureRandom)
Creates a new SecretSharing sheme with shares, threshold, secretBytes and a secure random source.
Creates a new SecretSharing sheme with shares, threshold, secretBytes and a secure random source.
- shares
the number of shares
- threshold
the number of shares required for the recovery of the secret bytes
- secretBytes
the actual secret
- random
the secure random source
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def chooseCanonicalCoefficients: IndexedSeq[BigInt]
Calculates a batch of coefficients needed for the polynomial in the canonical form.
Calculates a batch of coefficients needed for the polynomial in the canonical form.
- returns
the random coefficients
- final def choosePolynomial(degree: Int): Polynomial
Chooses a random polynomial with the given degrre in the canonical form.
Chooses a random polynomial with the given degrre in the canonical form.
- degree
the degree of the polynomial
- returns
the random polynomial
- Annotations
- @tailrec()
- def choosePrime: BigInt
Calculates a random prime p with the property s < p.
Calculates a random prime p with the property s < p.
- returns
a random prime
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def computeShares: IndexedSeq[(BigInt, BigInt)]
Computes the required number of random and distinct shares.
Computes the required number of random and distinct shares.
- returns
the shares
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def getCurrentTracer(): AbstractTracer
Returns the present tracer for this object.
Returns the present tracer for this object.
- returns
the current tracer, by default the NullTracer
- Definition Classes
- Tracing
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- val id: String
The partition id
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val k: Int
An alias for threshold
- val n: Int
An alias for shares
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def partitionAsJson(sizes: Array[Int]): JsonArray
Partitions the shares according to the given sizes and converts the different slices containing the shares into a JSON array containing the slices as JSON objects.
Partitions the shares according to the given sizes and converts the different slices containing the shares into a JSON array containing the slices as JSON objects.
- sizes
denotes a partition
- returns
the JSON array of slices containing the shares
- val polynomial: Polynomial
A random polynomial in the canonical form used to compute the shares
- val prime: BigInt
The prime modulus
- val random: SecureRandom
- val randomGenerator: RandomGenerator
Used to compute a LazyList of random BigInt numbers
- val s: BigInt
The secret encoded as non-negative BigInt
- def savePartition(sizes: Array[Int], path: Path): Unit
A convenience method.
A convenience method. Saves the partition in the order as given by the sizes.
- sizes
denotes the partition
- path
the path to the partition file
- def savePartition(sizes: Iterable[Int], path: Path): Unit
Saves the desired partition.
Saves the desired partition. For technical reasons this method delivers the slices in reverse order as given by the sizes.
- sizes
denotes the partition
- path
the path to the partition file
- val secretBytes: IndexedSeq[Byte]
- def sharePointPartition(sizes: Iterable[Int]): List[IndexedSeq[(BigInt, BigInt)]]
Partitions the share points into disjunct sequences according to the given sizes.
Partitions the share points into disjunct sequences according to the given sizes.
- sizes
denotes the sizes of the desired share point sequences
- returns
a list of share point sequences
- val sharePoints: IndexedSeq[(BigInt, BigInt)]
The actual shares
- def sharePointsAsJson(ps: IndexedSeq[(BigInt, BigInt)]): JsonObject
Translates the given shares into JSON.
Translates the given shares into JSON.
- ps
the shares
- returns
the JSON containing the shares
- lazy val sharePointsAsJson: JsonObject
All shares converted into a JSON object
- val shares: Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val threshold: Int
- def toString(): String
Gives a textual representation of this particular secret sharing sheme.
Gives a textual representation of this particular secret sharing sheme.
- returns
the textual representation
- Definition Classes
- SecretSharing → AnyRef → Any
- lazy val verified: Boolean
Indicates if cross checks with all possible and valid combinations of shares have been successful.
Indicates if cross checks with all possible and valid combinations of shares have been successful. This is a potentially expensive operation.
- def verifyAll: Boolean
Verifies that all valid combinations of shares recover the secret bytes.
Verifies that all valid combinations of shares recover the secret bytes.
- returns
indicates the outcome of all possible and valid cross checks
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withTracer[T](resultType: String, callee: AnyRef, method: String)(block: => T): T
Custom control structure for tracing of embraced code blocks.
Custom control structure for tracing of embraced code blocks.
- T
the actual type of the embraced code block
- resultType
denotes the return type
- callee
the call site
- method
denotes the method signature
- block
the embraced code block
- returns
returns whatever block returns
- Definition Classes
- Tracing
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated