pedersen-commitment-0.2.0: An implementation of Pedersen commitment schemes

PrimeField

Synopsis

# Documentation

data P Source #

A large, safe prime, p = 2q + 1, where q is a large prime

Instances

 Source # Methods(==) :: P -> P -> Bool #(/=) :: P -> P -> Bool # Source # Methodscompare :: P -> P -> Ordering #(<) :: P -> P -> Bool #(<=) :: P -> P -> Bool #(>) :: P -> P -> Bool #(>=) :: P -> P -> Bool #max :: P -> P -> P #min :: P -> P -> P # Source # MethodsshowsPrec :: Int -> P -> ShowS #show :: P -> String #showList :: [P] -> ShowS #

data Q Source #

A large prime such that p = 2q + 1 and p is also prime

Instances

 Source # Methods(==) :: Q -> Q -> Bool #(/=) :: Q -> Q -> Bool # Source # Methodscompare :: Q -> Q -> Ordering #(<) :: Q -> Q -> Bool #(<=) :: Q -> Q -> Bool #(>) :: Q -> Q -> Bool #(>=) :: Q -> Q -> Bool #max :: Q -> Q -> Q #min :: Q -> Q -> Q # Source # MethodsshowsPrec :: Int -> Q -> ShowS #show :: Q -> String #showList :: [Q] -> ShowS #

data G Source #

A generator order Q for prime field order P

Instances

 Source # Methods(==) :: G -> G -> Bool #(/=) :: G -> G -> Bool # Source # Methodscompare :: G -> G -> Ordering #(<) :: G -> G -> Bool #(<=) :: G -> G -> Bool #(>) :: G -> G -> Bool #(>=) :: G -> G -> Bool #max :: G -> G -> G #min :: G -> G -> G # Source # MethodsshowsPrec :: Int -> G -> ShowS #show :: G -> String #showList :: [G] -> ShowS #

data SPF Source #

A Safe Prime Field (Zp): Q = large prime P = 2Q + 1, also prime G = generator for Zp order q

spfP :: SPF -> P Source #

spfQ :: SPF -> Q Source #

spfG :: SPF -> G Source #

For computations using Safe Prime Field params

runSPFT :: SPF -> SPFM m a -> m a Source #

Compute g^e mod p

Compute b^e mod p

randomInZq :: MonadRandom m => SPF -> m Integer Source #

Generate random number in Zq

randomInZp :: MonadRandom m => SPF -> m Integer Source #

Generate random number in Zp