Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- powerVector :: (Eq f, Num f) => f -> Integer -> [f]
- hadamardp :: Num a => [a] -> [a] -> [a]
- dot :: Num a => [a] -> [a] -> a
- (^+^) :: Num a => [a] -> [a] -> [a]
- (^-^) :: Num a => [a] -> [a] -> [a]
- addP :: Point -> Point -> Point
- subP :: Point -> Point -> Point
- mulP :: PrimeField p -> Point -> Point
- addTwoMulP :: PrimeField p -> Point -> PrimeField p -> Point -> Point
- sumExps :: [PrimeField p] -> [Point] -> Point
- commit :: PrimeField p -> PrimeField p -> Point
- 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 :: Num f => Point -> Point -> f
- shamirZ :: (Show f, Num f) => Point -> Point -> f -> f
- shamirX :: (Show f, Num f) => Point -> Point -> Point -> Point -> f -> f -> f
- shamirX' :: Num f => Point -> Point -> Point -> f
- shamirU :: (Show f, Num f) => f -> f -> f -> f

# 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

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

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 #