pedersen-commitment-0.2.0: An implementation of Pedersen commitment schemes
Safe HaskellNone
LanguageHaskell2010

PrimeField

Synopsis

Documentation

data P Source #

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

Instances

Instances details
Show P Source # 
Instance details

Defined in PrimeField

Methods

showsPrec :: Int -> P -> ShowS #

show :: P -> String #

showList :: [P] -> ShowS #

Eq P Source # 
Instance details

Defined in PrimeField

Methods

(==) :: P -> P -> Bool #

(/=) :: P -> P -> Bool #

Ord P Source # 
Instance details

Defined in PrimeField

Methods

compare :: P -> P -> Ordering #

(<) :: P -> P -> Bool #

(<=) :: P -> P -> Bool #

(>) :: P -> P -> Bool #

(>=) :: P -> P -> Bool #

max :: P -> P -> P #

min :: P -> P -> P #

data Q Source #

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

Instances

Instances details
Show Q Source # 
Instance details

Defined in PrimeField

Methods

showsPrec :: Int -> Q -> ShowS #

show :: Q -> String #

showList :: [Q] -> ShowS #

Eq Q Source # 
Instance details

Defined in PrimeField

Methods

(==) :: Q -> Q -> Bool #

(/=) :: Q -> Q -> Bool #

Ord Q Source # 
Instance details

Defined in PrimeField

Methods

compare :: Q -> Q -> Ordering #

(<) :: Q -> Q -> Bool #

(<=) :: Q -> Q -> Bool #

(>) :: Q -> Q -> Bool #

(>=) :: Q -> Q -> Bool #

max :: Q -> Q -> Q #

min :: Q -> Q -> Q #

data G Source #

A generator order Q for prime field order P

Instances

Instances details
Show G Source # 
Instance details

Defined in PrimeField

Methods

showsPrec :: Int -> G -> ShowS #

show :: G -> String #

showList :: [G] -> ShowS #

Eq G Source # 
Instance details

Defined in PrimeField

Methods

(==) :: G -> G -> Bool #

(/=) :: G -> G -> Bool #

Ord G Source # 
Instance details

Defined in PrimeField

Methods

compare :: G -> G -> Ordering #

(<) :: G -> G -> Bool #

(<=) :: G -> G -> Bool #

(>) :: G -> G -> Bool #

(>=) :: G -> G -> Bool #

max :: G -> G -> G #

min :: G -> G -> G #

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 #

type SPFM = ReaderT SPF Source #

For computations using Safe Prime Field params

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

gexpSafeSPF :: SPF -> Integer -> Integer Source #

Compute g^e mod p

gexpSafeSPFM :: forall (m :: Type -> Type). Monad m => Integer -> SPFM m Integer Source #

expSafeSPF :: SPF -> Integer -> Integer -> Integer Source #

Compute b^e mod p

expSafeSPFM :: forall (m :: Type -> Type). Monad m => Integer -> Integer -> SPFM m Integer Source #

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

Generate random number in Zq

randomInZqM :: forall (m :: Type -> Type). MonadRandom m => SPFM m Integer Source #

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

Generate random number in Zp

randomInZpM :: forall (m :: Type -> Type). MonadRandom m => SPFM m Integer Source #

modpM :: forall (m :: Type -> Type). Monad m => Integer -> SPFM m Integer Source #

(|*|) :: forall (m :: Type -> Type). Monad m => SPFM m Integer -> SPFM m Integer -> SPFM m Integer Source #

(|+|) :: forall (m :: Type -> Type). Monad m => SPFM m Integer -> SPFM m Integer -> SPFM m Integer Source #