Copyright | Peter Robinson 2014 |
---|---|
License | LGPL |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- polyInterp :: Fractional a => [(a, a)] -> a -> a
- slidingFocus :: [a] -> [([a], a, [a])]
- data ByteShare = ByteShare {
- shareId :: !Int
- reconstructionThreshold :: !Int
- shareValue :: !Int
- data Share = Share {}
- encode :: Int -> Int -> ByteString -> IO [Share]
- decode :: [Share] -> ByteString
- encodeByte :: Int -> Int -> Polyn -> FField -> Vector ByteShare
- decodeByte :: [ByteShare] -> FField
- groupInto :: Int -> [a] -> [[a]]
- newtype FField = FField {
- number :: PrimeField 1021
- prime :: Int
- type Polyn = [FField]
- evalPolynomial :: Polyn -> FField -> FField
Documentation
polyInterp :: Fractional a => [(a, a)] -> a -> a Source #
Evaluate a Lagrange interpolation polynomial passing through the specified set of points.
slidingFocus :: [a] -> [([a], a, [a])] Source #
A share of an encoded byte.
ByteShare | |
|
:: 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.
:: [Share] | list of at least |
-> 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.
decodeByte :: [ByteShare] -> FField Source #
groupInto :: Int -> [a] -> [[a]] Source #
Groups a list into blocks of certain size. Running time: O(n)
A finite prime field. All computations are performed in this field.
FField | |
|
Instances
Eq FField Source # | |
Fractional FField Source # | |
Num FField Source # | |
Ord FField Source # | |
Read FField Source # | |
Show FField Source # | |
Generic FField Source # | |
FiniteField FField Source # | |
type Rep FField Source # | |
Defined in Crypto.SecretSharing.Internal type Rep FField = D1 (MetaData "FField" "Crypto.SecretSharing.Internal" "secret-sharing-1.0.1.2-BHUG0PSSg9MGAbGsSVWs8Q" True) (C1 (MetaCons "FField" PrefixI True) (S1 (MetaSel (Just "number") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (PrimeField 1021)))) |