secret-sharing-1.0.0.3: Information-theoretic secure secret sharing

CopyrightPeter Robinson 2014
LicenseLGPL
MaintainerPeter Robinson <peter.robinson@monoid.at>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Crypto.SecretSharing.Internal

Description

 

Synopsis

Documentation

data ByteShare Source

A share of an encoded byte.

Constructors

ByteShare 

Fields

shareId :: !Int

the index of this share

reconstructionThreshold :: !Int

number of shares required for reconstruction

shareValue :: !Int

the value of p(shareId) where p(x) is the generated (secret) polynomial

data Share Source

A share of the encoded secret.

Constructors

Share 

Fields

theShare :: ![ByteShare]
 

encode Source

Arguments

:: Int

m

-> Int

n

-> ByteString

the secret that we want to share

-> IO [Share] 

Encodes a ByteString as a list of n shares, m of which are required for reconstruction. Lives in the IO to access a random source.

decode Source

Arguments

:: [Share]

list of at least m shares

-> ByteString

reconstructed secret

Reconstructs a (secret) bytestring from a list of (at least m) shares. Throws AssertionFailed if the number of shares is too small.

groupInto :: Int -> [a] -> [[a]] Source

Groups a list into blocks of certain size. Running time: O(n)

newtype FField Source

A finite prime field. All computations are performed in this field.

Constructors

FField 

Fields

number :: PrimeField (I (O (I (I (I (I (I (I (I (I Z))))))))))
 

prime :: Int Source

The size of the finite field

type Polyn = [FField] Source

A polynomial over the finite field given as a list of coefficients.

evalPolynomial :: Polyn -> FField -> FField Source

Evaluates the polynomial at a given point.