Versions in this module Expand all Collapse all v0 v0.0.1 Oct 26, 2022 Changes in this version + var ErrNotBlum = errors.New("prime factor is not equivalent to 3 (mod 4)") + var ErrNotSafePrime = errors.New("supposed prime factor is not a safe prime") + var ErrPaillierEven = errors.New("modulus N is even") + var ErrPaillierLength = errors.New("wrong number bit length of Paillier modulus N") + var ErrPaillierNil = errors.New("modulus N is nil") + var ErrPrimeBadLength = errors.New("prime factor is not the right length") + var ErrPrimeNil = errors.New("prime is nil") + func KeyGen(pl *pool.Pool) (pk *PublicKey, sk *SecretKey) + func ValidateN(n *safenum.Modulus) error + func ValidatePrime(p *safenum.Nat) error + type Ciphertext struct + func (*Ciphertext) Domain() string + func (ct *Ciphertext) Add(pk *PublicKey, ct2 *Ciphertext) *Ciphertext + func (ct *Ciphertext) Equal(ctA *Ciphertext) bool + func (ct *Ciphertext) MarshalBinary() ([]byte, error) + func (ct *Ciphertext) Mul(pk *PublicKey, k *safenum.Int) *Ciphertext + func (ct *Ciphertext) Nat() *safenum.Nat + func (ct *Ciphertext) Randomize(pk *PublicKey, nonce *safenum.Nat) *safenum.Nat + func (ct *Ciphertext) UnmarshalBinary(data []byte) error + func (ct *Ciphertext) WriteTo(w io.Writer) (int64, error) + func (ct Ciphertext) Clone() *Ciphertext + type PublicKey struct + func NewPublicKey(n *safenum.Modulus) *PublicKey + func (PublicKey) Domain() string + func (pk *PublicKey) Modulus() *arith.Modulus + func (pk *PublicKey) ModulusSquared() *arith.Modulus + func (pk *PublicKey) N() *safenum.Modulus + func (pk *PublicKey) WriteTo(w io.Writer) (int64, error) + func (pk PublicKey) Enc(m *safenum.Int) (*Ciphertext, *safenum.Nat) + func (pk PublicKey) EncWithNonce(m *safenum.Int, nonce *safenum.Nat) *Ciphertext + func (pk PublicKey) Equal(other *PublicKey) bool + func (pk PublicKey) ValidateCiphertexts(cts ...*Ciphertext) bool + type SecretKey struct + func NewSecretKey(pl *pool.Pool) *SecretKey + func NewSecretKeyFromPrimes(P, Q *safenum.Nat) *SecretKey + func (sk *SecretKey) Dec(ct *Ciphertext) (*safenum.Int, error) + func (sk *SecretKey) DecWithRandomness(ct *Ciphertext) (*safenum.Int, *safenum.Nat, error) + func (sk *SecretKey) P() *safenum.Nat + func (sk *SecretKey) Phi() *safenum.Nat + func (sk *SecretKey) Q() *safenum.Nat + func (sk SecretKey) GeneratePedersen() (*pedersen.Parameters, *safenum.Nat)