Paillier-0.1.0.3: a simple Paillier cryptosystem

Safe HaskellNone

Crypto.Paillier

Synopsis

Documentation

data PubKey Source

Constructors

PubKey 

Fields

bits :: Int

e.g., 2048

nModulo :: Integer

n = pq

generator :: Integer

generator = n+1

nSquare :: Integer

n^2

Instances

data PrvKey Source

Constructors

PrvKey 

Fields

lambda :: Integer

lambda(n) = lcm(p-1, q-1)

x :: Integer
 

Instances

_encrypt :: PubKey -> PlainText -> Integer -> CipherTextSource

deterministic version of encryption

cipherMul :: PubKey -> CipherText -> CipherText -> CipherTextSource

ciphetext muliplication is known as homomorphic addition of plaintexts

cipherExp :: PubKey -> CipherText -> PlainText -> CipherTextSource

Homomorphic multiplication of plaintexts An encrypted plaintext raised to the power of another plaintext will decrypt to the product of the two plaintexts.