bulletproofs-1.1.0

Safe HaskellNone
LanguageHaskell2010

Bulletproofs.Utils

Synopsis

Documentation

h :: PA Source #

H = aG where a is not known

gs :: [PA] Source #

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

hs :: [PA] Source #

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.

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

dot :: Num a => [a] -> [a] -> a Source #

Dot product

(^+^) :: Num a => [a] -> [a] -> [a] Source #

Entry wise sum

(^-^) :: Num a => [a] -> [a] -> [a] Source #

Entry wise subtraction

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

slice :: Integer -> Integer -> [a] -> [a] 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 #

Arguments

:: Num f 
=> Int

n

-> [f]

list which should have length <= 2^n

-> [f]

list which will have length 2^n

Given n, append zeroes until the list has length 2^n.

log2Ceil :: Int -> Int Source #

Calculate ceiling of log base 2 of an integer.

chooseBlindingVectors :: (Num f, MonadRandom m) => Integer -> m ([f], [f]) Source #

shamirY :: PA -> PA -> Fr Source #

shamirZ :: PA -> PA -> Fr -> Fr Source #

shamirX :: PA -> PA -> PA -> PA -> Fr -> Fr -> Fr Source #

shamirX' :: PA -> PA -> PA -> Fr Source #

shamirU :: Fr -> Fr -> Fr -> Fr Source #