bulletproofs-1.0.1

Safe HaskellNone
LanguageHaskell2010

Bulletproofs.Utils

Synopsis

Documentation

powerVector :: (Eq f, Num f) => f -> Integer -> [f] Source #

Return a vector containing the first n powers of a

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

Hadamard product or entry wise multiplication of two vectors

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

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

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

addP :: Point -> Point -> Point Source #

Add two points of the same curve

subP :: Point -> Point -> Point Source #

Substract two points of the same curve

mulP :: PrimeField p -> Point -> Point Source #

Multiply a scalar and a point in an elliptic curve

addTwoMulP :: PrimeField p -> Point -> PrimeField p -> Point -> Point Source #

Double exponentiation (Shamir's trick): g0^x0 + g1^x1

sumExps :: [PrimeField p] -> [Point] -> Point Source #

Raise every point to the corresponding exponent, sum up results

commit :: PrimeField p -> PrimeField p -> Point 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 :: Num f => Point -> Point -> f Source #

shamirZ :: (Show f, Num f) => Point -> Point -> f -> f Source #

shamirX :: (Show f, Num f) => Point -> Point -> Point -> Point -> f -> f -> f Source #

shamirX' :: Num f => Point -> Point -> Point -> f Source #

shamirU :: (Show f, Num f) => f -> f -> f -> f Source #