Versions in this module Expand all Collapse all v1 deprecated v1.3.1 Apr 25, 2023 Changes in this version + const Conjugate + const GaloisGen + const MaxLogN + const MaxModuliCount + const MaxModuliSize + const PN12QP109 + const PN13QP218 + const PN14QP438 + const PN15QP880 + const PN16QP1761 + const RotationLeft + const RotationRight + var DefaultParams = []*Parameters + func GenModuli(params *Parameters) (Q []uint64, P []uint64) + func GenSwitchkeysRescalingParams(Q, P []uint64) (params []uint64) + type ChebyshevInterpolation struct + func Approximate(function func(complex128) complex128, a, b complex128, degree int) (cheby *ChebyshevInterpolation) + type Ciphertext struct + func NewCiphertext(params *Parameters, degree uint64, level uint64, scale float64) (ciphertext *Ciphertext) + func NewCiphertextRandom(params *Parameters, degree, level uint64, scale float64) (ciphertext *Ciphertext) + func (ciphertext *Ciphertext) GetDataLen(WithMetaData bool) (dataLen uint64) + func (ciphertext *Ciphertext) MarshalBinary() (data []byte, err error) + func (ciphertext *Ciphertext) UnmarshalBinary(data []byte) (err error) + func (el Ciphertext) Ciphertext() *Ciphertext + func (el Ciphertext) Copy(ctxCopy *ckksElement) (err error) + func (el Ciphertext) CopyNew() *ckksElement + func (el Ciphertext) CopyParams(ckkselement *ckksElement) + func (el Ciphertext) Degree() uint64 + func (el Ciphertext) DivScale(scale float64) + func (el Ciphertext) Element() *ckksElement + func (el Ciphertext) InvNTT(context *ring.Context, c *ckksElement) error + func (el Ciphertext) IsNTT() bool + func (el Ciphertext) Level() uint64 + func (el Ciphertext) MulScale(scale float64) + func (el Ciphertext) NTT(context *ring.Context, c *ckksElement) error + func (el Ciphertext) Plaintext() *Plaintext + func (el Ciphertext) Resize(params *Parameters, degree uint64) + func (el Ciphertext) Scale() float64 + func (el Ciphertext) SetIsNTT(value bool) + func (el Ciphertext) SetScale(scale float64) + func (el Ciphertext) SetValue(value []*ring.Poly) + func (el Ciphertext) Value() []*ring.Poly + type Context struct + type Decryptor interface + Decrypt func(ciphertext *Ciphertext, plaintext *Plaintext) + DecryptNew func(ciphertext *Ciphertext) (plaintext *Plaintext) + func NewDecryptor(params *Parameters, sk *SecretKey) Decryptor + type Encoder interface + Decode func(plaintext *Plaintext, slots uint64) (res []complex128) + Encode func(plaintext *Plaintext, values []complex128, slots uint64) + EncodeNew func(values []complex128, slots uint64) (plaintext *Plaintext) + func NewEncoder(params *Parameters) Encoder + type Encryptor interface + Encrypt func(plaintext *Plaintext, ciphertext *Ciphertext) + EncryptNew func(plaintext *Plaintext) *Ciphertext + func NewEncryptorFromPk(params *Parameters, pk *PublicKey) Encryptor + func NewEncryptorFromSk(params *Parameters, sk *SecretKey) Encryptor + type EvaluationKey struct + func NewRelinKey(params *Parameters) (evakey *EvaluationKey) + func (evaluationkey *EvaluationKey) GetDataLen(WithMetaData bool) (dataLen uint64) + func (evaluationkey *EvaluationKey) MarshalBinary() (data []byte, err error) + func (evaluationkey *EvaluationKey) UnmarshalBinary(data []byte) (err error) + func (evk *EvaluationKey) Get() *SwitchingKey + func (evk *EvaluationKey) Set(rlk [][2]*ring.Poly) + type Evaluator interface + Add func(op0, op1 Operand, ctOut *Ciphertext) + AddConst func(ct0 *Ciphertext, constant interface{}, ctOut *Ciphertext) + AddConstNew func(ct0 *Ciphertext, constant interface{}) (ctOut *Ciphertext) + AddNew func(op0, op1 Operand) (ctOut *Ciphertext) + AddNoMod func(op0, op1 Operand, ctOut *Ciphertext) + AddNoModNew func(op0, op1 Operand) (ctOut *Ciphertext) + Conjugate func(ct0 *Ciphertext, evakey *RotationKeys, ctOut *Ciphertext) + ConjugateNew func(ct0 *Ciphertext, evakey *RotationKeys) (ctOut *Ciphertext) + DivByi func(ct0 *Ciphertext, ct1 *Ciphertext) + DivByiNew func(ct0 *Ciphertext) (ctOut *Ciphertext) + DropLevel func(ct0 *Ciphertext, levels uint64) (err error) + DropLevelNew func(ct0 *Ciphertext, levels uint64) (ctOut *Ciphertext) + EvaluateChebyEco func(ct *Ciphertext, cheby *ChebyshevInterpolation, evakey *EvaluationKey) (res *Ciphertext) + EvaluateChebyFast func(ct *Ciphertext, cheby *ChebyshevInterpolation, evakey *EvaluationKey) (res *Ciphertext) + EvaluatePolyEco func(ct *Ciphertext, coeffs interface{}, evakey *EvaluationKey) (res *Ciphertext) + EvaluatePolyFast func(ct *Ciphertext, coeffs interface{}, evakey *EvaluationKey) (res *Ciphertext) + InverseNew func(ct0 *Ciphertext, steps uint64, evakey *EvaluationKey) (res *Ciphertext) + MulByPow2 func(ct0 *ckksElement, pow2 uint64, ctOut *ckksElement) + MulByPow2New func(ct0 *Ciphertext, pow2 uint64) (ctOut *Ciphertext) + MulRelin func(op0, op1 Operand, evakey *EvaluationKey, ctOut *Ciphertext) + MulRelinNew func(op0, op1 Operand, evakey *EvaluationKey) (ctOut *Ciphertext) + MultByConst func(ct0 *Ciphertext, constant interface{}, ctOut *Ciphertext) + MultByConstAndAdd func(ct0 *Ciphertext, constant interface{}, ctOut *Ciphertext) + MultByConstNew func(ct0 *Ciphertext, constant interface{}) (ctOut *Ciphertext) + MultByi func(ct0 *Ciphertext, ct1 *Ciphertext) + MultByiNew func(ct0 *Ciphertext) (ctOut *Ciphertext) + Neg func(ct0 *Ciphertext, ctOut *Ciphertext) + NegNew func(ct0 *Ciphertext) (ctOut *Ciphertext) + Power func(ct0 *Ciphertext, degree uint64, evakey *EvaluationKey, res *Ciphertext) + PowerNew func(op *Ciphertext, degree uint64, evakey *EvaluationKey) (opOut *Ciphertext) + PowerOf2 func(el0 *Ciphertext, logPow2 uint64, evakey *EvaluationKey, elOut *Ciphertext) + Reduce func(ct0 *Ciphertext, ctOut *Ciphertext) error + ReduceNew func(ct0 *Ciphertext) (ctOut *Ciphertext) + Relinearize func(ct0 *Ciphertext, evakey *EvaluationKey, ctOut *Ciphertext) + RelinearizeNew func(ct0 *Ciphertext, evakey *EvaluationKey) (ctOut *Ciphertext) + Rescale func(ct0 *Ciphertext, threshold float64, c1 *Ciphertext) (err error) + RescaleMany func(ct0 *Ciphertext, nbRescales uint64, c1 *Ciphertext) (err error) + RotateColumns func(ct0 *Ciphertext, k uint64, evakey *RotationKeys, ctOut *Ciphertext) + RotateColumnsNew func(ct0 *Ciphertext, k uint64, evakey *RotationKeys) (ctOut *Ciphertext) + RotateHoisted func(ctIn *Ciphertext, rotations []uint64, rotkeys *RotationKeys) (cOut map[uint64]*Ciphertext) + ScaleUp func(ct0 *Ciphertext, scale float64, ctOut *Ciphertext) + ScaleUpNew func(ct0 *Ciphertext, scale float64) (ctOut *Ciphertext) + Sub func(op0, op1 Operand, ctOut *Ciphertext) + SubNew func(op0, op1 Operand) (ctOut *Ciphertext) + SubNoMod func(op0, op1 Operand, ctOut *Ciphertext) + SubNoModNew func(op0, op1 Operand) (ctOut *Ciphertext) + SwitchKeys func(ct0 *Ciphertext, switchingKey *SwitchingKey, ctOut *Ciphertext) + SwitchKeysNew func(ct0 *Ciphertext, switchingKey *SwitchingKey) (ctOut *Ciphertext) + func NewEvaluator(params *Parameters) Evaluator + type KeyGenerator interface + GenKeyPair func() (sk *SecretKey, pk *PublicKey) + GenKeyPairSparse func(hw uint64) (sk *SecretKey, pk *PublicKey) + GenPublicKey func(sk *SecretKey) (pk *PublicKey) + GenRelinKey func(sk *SecretKey) (evakey *EvaluationKey) + GenRot func(rotType Rotation, sk *SecretKey, k uint64, rotKey *RotationKeys) + GenRotationKeysPow2 func(skOutput *SecretKey) (rotKey *RotationKeys) + GenSecretKey func() (sk *SecretKey) + GenSecretKeySparse func(hw uint64) (sk *SecretKey) + GenSecretKeyWithDistrib func(p float64) (sk *SecretKey) + GenSwitchingKey func(skInput, skOutput *SecretKey) (newevakey *SwitchingKey) + func NewKeyGenerator(params *Parameters) KeyGenerator + type LogModuli struct + LogPi []uint64 + LogQi []uint64 + func (m *LogModuli) Copy() LogModuli + type Moduli struct + Pi []uint64 + Qi []uint64 + func (m *Moduli) Copy() Moduli + type Operand interface + Degree func() uint64 + Element func() *ckksElement + Level func() uint64 + Scale func() float64 + type Parameters struct + LogN uint64 + LogSlots uint64 + Scale float64 + Sigma float64 + func NewParametersFromLogModuli(LogN, LogSlots uint64, Scale float64, logModuli LogModuli, Sigma float64) (params *Parameters) + func NewParametersFromModuli(LogN, LogSlots uint64, Scale float64, moduli Moduli, Sigma float64) (params *Parameters) + func (p *Parameters) Alpha() uint64 + func (p *Parameters) Beta() uint64 + func (p *Parameters) Copy() (paramsCopy *Parameters) + func (p *Parameters) Equals(other *Parameters) (res bool) + func (p *Parameters) GenFromLogModuli() + func (p *Parameters) GenFromModuli() + func (p *Parameters) IsValid() bool + func (p *Parameters) LogQP() uint64 + func (p *Parameters) MarshalBinary() ([]byte, error) + func (p *Parameters) MaxLevel() uint64 + func (p *Parameters) NewPolyP() *ring.Poly + func (p *Parameters) NewPolyQ() *ring.Poly + func (p *Parameters) NewPolyQP() *ring.Poly + func (p *Parameters) UnmarshalBinary(data []byte) error + type Plaintext struct + func NewPlaintext(params *Parameters, level uint64, scale float64) *Plaintext + func (el Plaintext) Ciphertext() *Ciphertext + func (el Plaintext) Copy(ctxCopy *ckksElement) (err error) + func (el Plaintext) CopyNew() *ckksElement + func (el Plaintext) CopyParams(ckkselement *ckksElement) + func (el Plaintext) Degree() uint64 + func (el Plaintext) DivScale(scale float64) + func (el Plaintext) Element() *ckksElement + func (el Plaintext) InvNTT(context *ring.Context, c *ckksElement) error + func (el Plaintext) IsNTT() bool + func (el Plaintext) Level() uint64 + func (el Plaintext) MulScale(scale float64) + func (el Plaintext) NTT(context *ring.Context, c *ckksElement) error + func (el Plaintext) Plaintext() *Plaintext + func (el Plaintext) Resize(params *Parameters, degree uint64) + func (el Plaintext) Scale() float64 + func (el Plaintext) SetIsNTT(value bool) + func (el Plaintext) SetScale(scale float64) + func (el Plaintext) SetValue(value []*ring.Poly) + func (el Plaintext) Value() []*ring.Poly + type PublicKey struct + func NewPublicKey(params *Parameters) (pk *PublicKey) + func (pk *PublicKey) Get() [2]*ring.Poly + func (pk *PublicKey) GetDataLen(WithMetaData bool) (dataLen uint64) + func (pk *PublicKey) MarshalBinary() (data []byte, err error) + func (pk *PublicKey) Set(poly [2]*ring.Poly) + func (pk *PublicKey) UnmarshalBinary(data []byte) (err error) + type Rotation int + type RotationKeys struct + func NewRotationKeys() (rotKey *RotationKeys) + func (rotKey *RotationKeys) SetRotKey(params *Parameters, evakey [][2]*ring.Poly, rotType Rotation, k uint64) + func (rotationkey *RotationKeys) GetDataLen(WithMetaData bool) (dataLen uint64) + func (rotationkey *RotationKeys) MarshalBinary() (data []byte, err error) + func (rotationkey *RotationKeys) UnmarshalBinary(data []byte) (err error) + type SecretKey struct + func NewSecretKey(params *Parameters) *SecretKey + func (sk *SecretKey) Get() *ring.Poly + func (sk *SecretKey) GetDataLen(WithMetaData bool) (dataLen uint64) + func (sk *SecretKey) MarshalBinary() (data []byte, err error) + func (sk *SecretKey) Set(poly *ring.Poly) + func (sk *SecretKey) UnmarshalBinary(data []byte) (err error) + type SwitchingKey struct + func NewSwitchingKey(params *Parameters) (evakey *SwitchingKey) + func (switchkey *SwitchingKey) GetDataLen(WithMetaData bool) (dataLen uint64) + func (switchkey *SwitchingKey) MarshalBinary() (data []byte, err error) + func (switchkey *SwitchingKey) UnmarshalBinary(data []byte) (err error) + func (swk *SwitchingKey) Get() [][2]*ring.Poly Other modules containing this package github.com/tuneinsight/lattigo/v3 github.com/tuneinsight/lattigo/v4