Versions in this module Expand all Collapse all v3 v3.0.5 Jun 13, 2022 Changes in this version + const Chebyshev + const Monomial + type BasisType int type PolynomialBasis + Value map[int]*Ciphertext + func NewPolynomialBasis(ct *Ciphertext, basistype BasisType) (p *PolynomialBasis) + func (p *PolynomialBasis) GenPower(n int, lazy bool, scale float64, eval Evaluator) (err error) + func (p *PolynomialBasis) MarshalBinary() (data []byte, err error) + func (p *PolynomialBasis) UnmarshalBinary(data []byte) (err error) v3.0.4 Apr 26, 2022 Changes in this version type Evaluator + BuffCt func() *Ciphertext + BuffQ func() [3]*ring.Poly v3.0.2 Feb 21, 2022 v3.0.1 Feb 21, 2022 Changes in this version + func DivideComplex128SliceVec(values []complex128, scaleVal complex128) + func SpecialFFTUL8Vec(values []complex128, N, M int, rotGroup []int, roots []complex128) + func SpecialFFTVec(values []complex128, N, M int, rotGroup []int, roots []complex128) + func SpecialiFFTUL8Vec(values []complex128, N, M int, rotGroup []int, roots []complex128) + func SpecialiFFTVec(values []complex128, N, M int, rotGroup []int, roots []complex128) type Encoder + Embed func(values interface{}, logSlots int, scale float64, montgomery bool, ...) type ParametersLiteral + H int v3.0.0 Feb 21, 2022 Changes in this version + const ChebyshevBasis + const GaloisGen + const IsNegligbleThreshold + const StandardBasis + var DefaultConjugateInvariantParams = []ParametersLiteral + var DefaultParams = []ParametersLiteral + var DefaultPostQuantumConjugateInvariantParams = []ParametersLiteral + var DefaultPostQuantumParams = []ParametersLiteral + var PN12QP101CIpq = ParametersLiteral + var PN12QP101pq = ParametersLiteral + var PN12QP109 = ParametersLiteral + var PN12QP109CI = ParametersLiteral + var PN13QP202CIpq = ParametersLiteral + var PN13QP202pq = ParametersLiteral + var PN13QP218 = ParametersLiteral + var PN13QP218CI = ParametersLiteral + var PN14QP411CIpq = ParametersLiteral + var PN14QP411pq = ParametersLiteral + var PN14QP438 = ParametersLiteral + var PN14QP438CI = ParametersLiteral + var PN15QP827CIpq = ParametersLiteral + var PN15QP827pq = ParametersLiteral + var PN15QP880 = ParametersLiteral + var PN15QP880CI = ParametersLiteral + var PN16QP1654CIpq = ParametersLiteral + var PN16QP1654pq = ParametersLiteral + var PN16QP1761 = ParametersLiteral + var PN16QP1761CI = ParametersLiteral + func BsgsIndex(el interface{}, slots, N1 int) (index map[int][]int, rotN1, rotN2 []int) + func FindBestBSGSSplit(diagMatrix interface{}, maxN int, maxRatio float64) (minN int) + func GenSwitchkeysRescalingParams(Q, P []uint64) (params []uint64) + func NewPublicKey(params Parameters) (pk *rlwe.PublicKey) + func NewRelinearizationKey(params Parameters) *rlwe.RelinearizationKey + func NewRotationKeySet(params Parameters, galoisElements []uint64) *rlwe.RotationKeySet + func NewSecretKey(params Parameters) (sk *rlwe.SecretKey) + func NewSwitchingKey(params Parameters) *rlwe.SwitchingKey + func NttAndMontgomeryLvl(level int, logSlots int, ringQ *ring.Ring, montgomery bool, pol *ring.Poly) + func SliceBitReverseInPlaceComplex128(slice []complex128, N int) + func SliceBitReverseInPlaceFloat64(slice []float64, N int) + func SliceBitReverseInPlaceRingComplex(slice []*ring.Complex, N int) + func StandardDeviation(vec []float64, scale float64) (std float64) + type Ciphertext struct + Scale float64 + func NewCiphertext(params Parameters, degree, level int, scale float64) (ciphertext *Ciphertext) + func NewCiphertextAtLevelFromPoly(level int, poly [2]*ring.Poly) *Ciphertext + func NewCiphertextRandom(prng utils.PRNG, params Parameters, degree, level int, scale float64) (ciphertext *Ciphertext) + func (ct *Ciphertext) Copy(ctp *Ciphertext) + func (ct *Ciphertext) CopyNew() (ctc *Ciphertext) + func (ct *Ciphertext) GetDataLen(WithMetaData bool) (dataLen int) + func (ct *Ciphertext) MarshalBinary() (data []byte, err error) + func (ct *Ciphertext) ScalingFactor() float64 + func (ct *Ciphertext) SetScalingFactor(scale float64) + func (ct *Ciphertext) UnmarshalBinary(data []byte) (err error) + type Decryptor interface + Decrypt func(ciphertext *Ciphertext, plaintext *Plaintext) + DecryptNew func(ciphertext *Ciphertext) (plaintext *Plaintext) + ShallowCopy func() Decryptor + WithKey func(sk *rlwe.SecretKey) Decryptor + func NewDecryptor(params Parameters, sk *rlwe.SecretKey) Decryptor + type DomainSwitcher struct + func NewDomainSwitcher(params Parameters, comlexToRealSwk *SwkComplexToReal, ...) (DomainSwitcher, error) + func (switcher *DomainSwitcher) ComplexToReal(ctIn, ctOut *Ciphertext) + func (switcher *DomainSwitcher) RealToComplex(ctIn, ctOut *Ciphertext) + type Encoder interface + Decode func(plaintext *Plaintext, logSlots int) (res []complex128) + DecodeCoeffs func(plaintext *Plaintext) (res []float64) + DecodeCoeffsPublic func(plaintext *Plaintext, bound float64) (res []float64) + DecodePublic func(plaintext *Plaintext, logSlots int, sigma float64) []complex128 + DecodeSlots func(plaintext *Plaintext, logSlots int) (res []complex128) + DecodeSlotsPublic func(plaintext *Plaintext, logSlots int, sigma float64) []complex128 + Encode func(values interface{}, plaintext *Plaintext, logSlots int) + EncodeCoeffs func(values []float64, plaintext *Plaintext) + EncodeCoeffsNew func(values []float64, level int, scale float64) (plaintext *Plaintext) + EncodeNew func(values interface{}, level int, scale float64, logSlots int) (plaintext *Plaintext) + EncodeSlots func(values interface{}, plaintext *Plaintext, logSlots int) + EncodeSlotsNew func(values interface{}, level int, scale float64, logSlots int) (plaintext *Plaintext) + GetErrSTDCoeffDomain func(valuesWant, valuesHave []complex128, scale float64) (std float64) + GetErrSTDSlotDomain func(valuesWant, valuesHave []complex128, scale float64) (std float64) + ShallowCopy func() Encoder + func NewEncoder(params Parameters) Encoder + type EncoderBigComplex interface + Decode func(plaintext *Plaintext, logSlots int) (res []*ring.Complex) + DecodePublic func(plaintext *Plaintext, logSlots int, sigma float64) (res []*ring.Complex) + Encode func(values []*ring.Complex, plaintext *Plaintext, logSlots int) + EncodeNew func(values []*ring.Complex, level int, scale float64, logSlots int) (plaintext *Plaintext) + FFT func(values []*ring.Complex, N int) + InvFFT func(values []*ring.Complex, N int) + ShallowCopy func() EncoderBigComplex + func NewEncoderBigComplex(params Parameters, logPrecision int) EncoderBigComplex + type Encryptor interface + Encrypt func(plaintext *Plaintext, ciphertext *Ciphertext) + EncryptFromCRP func(plaintext *Plaintext, crp *ring.Poly, ciphertext *Ciphertext) + EncryptFromCRPNew func(plaintext *Plaintext, crp *ring.Poly) *Ciphertext + EncryptNew func(plaintext *Plaintext) *Ciphertext + ShallowCopy func() Encryptor + WithKey func(key interface{}) Encryptor + func NewEncryptor(params Parameters, key interface{}) Encryptor + type Evaluator interface + Add func(op0, op1 Operand, ctOut *Ciphertext) + AddConst func(ctIn *Ciphertext, constant interface{}, ctOut *Ciphertext) + AddConstNew func(ctIn *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) + Average func(ctIn *Ciphertext, batch int, ctOut *Ciphertext) + Conjugate func(ctIn *Ciphertext, ctOut *Ciphertext) + ConjugateNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + CtxPool func() *Ciphertext + DivByi func(ctIn *Ciphertext, ctOut *Ciphertext) + DivByiNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + DropLevel func(ctIn *Ciphertext, levels int) + DropLevelNew func(ctIn *Ciphertext, levels int) (ctOut *Ciphertext) + EvaluatePoly func(ctIn *Ciphertext, pol *Polynomial, targetScale float64) (ctOut *Ciphertext, err error) + EvaluatePolyVector func(ctIn *Ciphertext, pols []*Polynomial, encoder Encoder, slotIndex map[int][]int, ...) (ctOut *Ciphertext, err error) + GetKeySwitcher func() *rlwe.KeySwitcher + InnerSum func(ctIn *Ciphertext, batch, n int, ctOut *Ciphertext) + InnerSumLog func(ctIn *Ciphertext, batch, n int, ctOut *Ciphertext) + InverseNew func(ctIn *Ciphertext, steps int) (ctOut *Ciphertext) + LinearTransform func(ctIn *Ciphertext, linearTransform interface{}, ctOut []*Ciphertext) + LinearTransformNew func(ctIn *Ciphertext, linearTransform interface{}) (ctOut []*Ciphertext) + Mul func(op0, op1 Operand, ctOut *Ciphertext) + MulAndAdd func(op0, op1 Operand, ctOut *Ciphertext) + MulByPow2 func(ctIn *Ciphertext, pow2 int, ctOut *Ciphertext) + MulByPow2New func(ctIn *Ciphertext, pow2 int) (ctOut *Ciphertext) + MulNew func(op0, op1 Operand) (ctOut *Ciphertext) + MulRelin func(op0, op1 Operand, ctOut *Ciphertext) + MulRelinAndAdd func(op0, op1 Operand, ctOut *Ciphertext) + MulRelinNew func(op0, op1 Operand) (ctOut *Ciphertext) + MultByConst func(ctIn *Ciphertext, constant interface{}, ctOut *Ciphertext) + MultByConstAndAdd func(ctIn *Ciphertext, constant interface{}, ctOut *Ciphertext) + MultByConstNew func(ctIn *Ciphertext, constant interface{}) (ctOut *Ciphertext) + MultByGaussianInteger func(ctIn *Ciphertext, cReal, cImag interface{}, ctOut *Ciphertext) + MultByGaussianIntegerAndAdd func(ctIn *Ciphertext, cReal, cImag interface{}, ctOut *Ciphertext) + MultByi func(ctIn *Ciphertext, ctOut *Ciphertext) + MultByiNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + MultiplyByDiagMatrix func(ctIn *Ciphertext, matrix LinearTransform, c2DecompQP []rlwe.PolyQP, ...) + MultiplyByDiagMatrixBSGS func(ctIn *Ciphertext, matrix LinearTransform, c2DecompQP []rlwe.PolyQP, ...) + Neg func(ctIn *Ciphertext, ctOut *Ciphertext) + NegNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + PermuteNTTHoisted func(level int, c0, c1 *ring.Poly, c2DecompQP []rlwe.PolyQP, k int, ...) + PermuteNTTHoistedNoModDown func(level int, c0 *ring.Poly, c2DecompQP []rlwe.PolyQP, k int, ...) + PoolQMul func() [3]*ring.Poly + Power func(ctIn *Ciphertext, degree int, ctOut *Ciphertext) + PowerNew func(ctIn *Ciphertext, degree int) (ctOut *Ciphertext) + PowerOf2 func(ctIn *Ciphertext, logPow2 int, ctOut *Ciphertext) + Reduce func(ctIn *Ciphertext, ctOut *Ciphertext) error + ReduceNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + Relinearize func(ctIn *Ciphertext, ctOut *Ciphertext) + RelinearizeNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + Replicate func(ctIn *Ciphertext, batch, n int, ctOut *Ciphertext) + ReplicateLog func(ctIn *Ciphertext, batch, n int, ctOut *Ciphertext) + Rescale func(ctIn *Ciphertext, minScale float64, ctOut *Ciphertext) (err error) + Rotate func(ctIn *Ciphertext, k int, ctOut *Ciphertext) + RotateHoisted func(ctIn *Ciphertext, rotations []int, ctOut map[int]*Ciphertext) + RotateHoistedNew func(ctIn *Ciphertext, rotations []int) (ctOut map[int]*Ciphertext) + RotateHoistedNoModDownNew func(level int, rotations []int, c0 *ring.Poly, c2DecompQP []rlwe.PolyQP) (cOut map[int][2]rlwe.PolyQP) + RotateNew func(ctIn *Ciphertext, k int) (ctOut *Ciphertext) + ScaleUp func(ctIn *Ciphertext, scale float64, ctOut *Ciphertext) + ScaleUpNew func(ctIn *Ciphertext, scale float64) (ctOut *Ciphertext) + SetScale func(ctIn *Ciphertext, scale float64) + ShallowCopy func() Evaluator + 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(ctIn *Ciphertext, switchingKey *rlwe.SwitchingKey, ctOut *Ciphertext) + SwitchKeysNew func(ctIn *Ciphertext, switchingKey *rlwe.SwitchingKey) (ctOut *Ciphertext) + Trace func(ctIn *Ciphertext, logSlotsStart, logSlotsEnd int, ctOut *Ciphertext) + TraceNew func(ctIn *Ciphertext, logSlotsStart, logSlotsEnd int) (ctOut *Ciphertext) + WithKey func(rlwe.EvaluationKey) Evaluator + func NewEvaluator(params Parameters, evaluationKey rlwe.EvaluationKey) Evaluator + type KeyGenerator interface + GenSwitchingKeysForBridge func(skCKKS, skCI *rlwe.SecretKey) (*SwkComplexToReal, *SwkRealToComplex) + func NewKeyGenerator(params Parameters) KeyGenerator + type LinearTransform struct + Level int + LogSlots int + N1 int + Scale float64 + Vec map[int]rlwe.PolyQP + func GenLinearTransform(encoder Encoder, value interface{}, level int, scale float64, logslots int) LinearTransform + func GenLinearTransformBSGS(encoder Encoder, value interface{}, level int, scale, BSGSRatio float64, ...) (LT LinearTransform) + func NewLinearTransform(params Parameters, nonZeroDiags []int, level, logSlots int, BSGSRatio float64) LinearTransform + func (LT *LinearTransform) Encode(encoder Encoder, value interface{}, scale float64) + func (LT *LinearTransform) Rotations() (rotations []int) + type Operand interface + Degree func() int + El func() *rlwe.Ciphertext + Level func() int + ScalingFactor func() float64 + SetScalingFactor func(float64) + type Parameters struct + func NewParameters(rlweParams rlwe.Parameters, logSlot int, defaultScale float64) (p Parameters, err error) + func NewParametersFromLiteral(pl ParametersLiteral) (Parameters, error) + func (p *Parameters) UnmarshalBinary(data []byte) (err error) + func (p *Parameters) UnmarshalJSON(data []byte) (err error) + func (p Parameters) CopyNew() Parameters + func (p Parameters) DefaultScale() float64 + func (p Parameters) Equals(other Parameters) bool + func (p Parameters) LogQLvl(level int) int + func (p Parameters) LogSlots() int + func (p Parameters) MarshalBinary() ([]byte, error) + func (p Parameters) MarshalBinarySize() int + func (p Parameters) MarshalJSON() ([]byte, error) + func (p Parameters) MaxLevel() int + func (p Parameters) MaxLogSlots() int + func (p Parameters) MaxSlots() int + func (p Parameters) QLvl(level int) *big.Int + func (p Parameters) RotationsForInnerSum(batch, n int) (rotations []int) + func (p Parameters) RotationsForInnerSumLog(batch, n int) (rotations []int) + func (p Parameters) RotationsForLinearTransform(nonZeroDiags interface{}, logSlots int, BSGSratio float64) (rotations []int) + func (p Parameters) RotationsForReplicate(batch, n int) (rotations []int) + func (p Parameters) RotationsForReplicateLog(batch, n int) (rotations []int) + func (p Parameters) RotationsForTrace(logSlotsStart, logSlotsEnd int) (rotations []int) + func (p Parameters) Slots() int + func (p Parameters) StandardParameters() (pckks Parameters, err error) + type ParametersLiteral struct + DefaultScale float64 + LogN int + LogP []int + LogQ []int + LogSlots int + P []uint64 + Q []uint64 + RingType ring.Type + Sigma float64 + type Plaintext struct + Scale float64 + func NewPlaintext(params Parameters, level int, scale float64) *Plaintext + func NewPlaintextAtLevelFromPoly(level int, poly *ring.Poly) *Plaintext + func (p *Plaintext) ScalingFactor() float64 + func (p *Plaintext) SetScalingFactor(scale float64) + type Polynomial struct + A float64 + B float64 + Basis PolynomialBasis + Coeffs []complex128 + Lead bool + MaxDeg int + func Approximate(function interface{}, a, b float64, degree int) (pol *Polynomial) + func NewPoly(coeffs []complex128) (p *Polynomial) + func (p *Polynomial) Degree() int + func (p *Polynomial) Depth() int + type PolynomialBasis int + type PrecisionStats struct + ImagDist []struct{ ... } + L2Dist []struct{ ... } + MaxDelta Stats + MaxPrecision Stats + MeanDelta Stats + MeanPrecision Stats + MedianDelta Stats + MedianPrecision Stats + MinDelta Stats + MinPrecision Stats + RealDist []struct{ ... } + STDFreq float64 + STDTime float64 + func GetPrecisionStats(params Parameters, encoder Encoder, decryptor Decryptor, ...) (prec PrecisionStats) + func (prec PrecisionStats) String() string + type Stats struct + Imag float64 + L2 float64 + Real float64 + type SwkComplexToReal struct + type SwkRealToComplex struct Other modules containing this package github.com/tuneinsight/lattigo github.com/tuneinsight/lattigo/v4