Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- h :: PA
- gs :: [PA]
- hs :: [PA]
- oracle :: PrimeField f => ByteString -> f
- pointToBS :: PA -> ByteString
- generateH :: [Char] -> PA
- powerVector :: (Eq f, Num f) => f -> Integer -> [f]
- hadamard :: Num a => [a] -> [a] -> [a]
- dot :: Num a => [a] -> [a] -> a
- (^+^) :: Num a => [a] -> [a] -> [a]
- (^-^) :: Num a => [a] -> [a] -> [a]
- addTwoMulP :: Fr -> PA -> Fr -> PA -> PA
- sumExps :: [Fr] -> [PA] -> PA
- commit :: Fr -> Fr -> PA
- isLogBase2 :: Integer -> Bool
- logBase2 :: Integer -> Integer
- logBase2M :: Integer -> Maybe Integer
- slice :: Integer -> Integer -> [a] -> [a]
- padToNearestPowerOfTwo :: Num f => [f] -> [f]
- padToNearestPowerOfTwoOf :: Num f => Int -> [f] -> [f]
- log2Ceil :: Int -> Int
- randomN :: MonadRandom m => Integer -> m Integer
- chooseBlindingVectors :: (Num f, MonadRandom m) => Integer -> m ([f], [f])
- shamirY :: PA -> PA -> Fr
- shamirZ :: PA -> PA -> Fr -> Fr
- shamirX :: PA -> PA -> PA -> PA -> Fr -> Fr -> Fr
- shamirX' :: PA -> PA -> PA -> Fr
- shamirU :: Fr -> Fr -> Fr -> Fr
Documentation
Generate vector of generators in a deterministic way from the curve generator g by applying H(encode(g) || i) where H is a secure hash function
Generate vector of generators in a deterministic way from the curve generator h by applying H(encode(h) || i) where H is a secure hash function
oracle :: PrimeField f => ByteString -> f Source #
A random oracle. In the Fiat-Shamir heuristic, its input is specifically the transcript of the interaction up to that point.
pointToBS :: PA -> ByteString Source #
generateH :: [Char] -> PA Source #
Iterative algorithm to generate H. The important thing about the H value is that nobody gets to know its discrete logarithm "k" such that H = kG
powerVector :: (Eq f, Num f) => f -> Integer -> [f] Source #
Return a vector containing the first n powers of a
hadamard :: Num a => [a] -> [a] -> [a] Source #
Hadamard product or entry wise multiplication of two vectors
addTwoMulP :: Fr -> PA -> Fr -> PA -> PA Source #
Double exponentiation (Shamir's trick): g0^x0 + g1^x1
sumExps :: [Fr] -> [PA] -> PA Source #
Raise every point to the corresponding exponent, sum up results
commit :: Fr -> Fr -> PA Source #
Create a Pedersen commitment to a value given a value and a blinding factor
isLogBase2 :: Integer -> Bool Source #
padToNearestPowerOfTwo :: Num f => [f] -> [f] Source #
Append minimal amount of zeroes until the list has a length which is a power of two.
padToNearestPowerOfTwoOf Source #
Given n, append zeroes until the list has length 2^n.
chooseBlindingVectors :: (Num f, MonadRandom m) => Integer -> m ([f], [f]) Source #