bulletproofs-0.4.0

Bulletproofs.Utils

Synopsis

# Documentation

class AsInteger a where Source #

Methods

asInteger :: a -> Integer Source #

Instances
 Source # Instance detailsDefined in Bulletproofs.Utils Methods Source # Instance detailsDefined in Bulletproofs.Utils Methods

class (Num f, Fractional f) => Field f where Source #

Methods

fSquare :: f -> f Source #

Instances
 Source # Instance detailsDefined in Bulletproofs.Utils Methods

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 #

Add two points of the same curve

Substract two points of the same curve

mulP :: AsInteger f => f -> Point -> Point Source #

Multiply a scalar and a point in an elliptic curve

addTwoMulP :: AsInteger f => f -> Point -> f -> Point -> Point Source #

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

sumExps :: AsInteger f => [f] -> [Point] -> Point Source #

Raise every point to the corresponding exponent, sum up results

commit :: AsInteger f => f -> f -> 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.

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.

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 #