klefki.crypto.damgard_jurik

Module Contents

Classes

DJPaillier

Functions

damgard_jurik_reduce(a: int, n: int, s=1) → int

Computes i given a = (1 + n)^i (mod n^(s+1)).

klefki.crypto.damgard_jurik.damgard_jurik_reduce(a: int, n: int, s=1) → int

Computes i given a = (1 + n)^i (mod n^(s+1)). :param a: The integer a in the above equation. :param s: The integer s in the above equation. :param n: The integer n in the above equation. :return: The integer i in the above equation.

class klefki.crypto.damgard_jurik.DJPaillier(P, Q, s=1, strict=False)

Bases: klefki.crypto.paillier.Paillier

static cal_privkey(P, Q, s=1)
classmethod encrypt(cls, m, pub, s=1, r=None)
classmethod decrypt(cls, c, priv, pub, s=1)
E(self, m, pub=None, s=None, r=None)
D(self, c, priv=None, pub=None, s=None)