Versions in this module Expand all Collapse all v4 v4.1.0 Nov 22, 2022 Changes in this version + const DefaultNTTFlag + func NewPRNGEncryptor(params Parameters, key *rlwe.SecretKey) rlwe.PRNGEncryptor type Encoder + ScaleDown func(level int, pIn, pOut *ring.Poly) + ScaleUp func(level int, pIn, pOut *ring.Poly) type Evaluator + InnerSum func(ctIn *rlwe.Ciphertext, batch, n int, ctOut *rlwe.Ciphertext) + Replicate func(ctIn *rlwe.Ciphertext, batch, n int, ctOut *rlwe.Ciphertext) + RotateHoistedNoModDownNew func(level int, rotations []int, c0 *ring.Poly, c2DecompQP []ringqp.Poly) (cOut map[int]rlwe.CiphertextQP) type Parameters + func (p Parameters) ParametersLiteral() ParametersLiteral v4.0.0 Oct 4, 2022 Changes in this version + const GaloisGen + var DefaultParams = []ParametersLiteral + var DefaultPostQuantumParams = []ParametersLiteral + var PN12QP101pq = ParametersLiteral + var PN12QP109 = ParametersLiteral + var PN13QP202pq = ParametersLiteral + var PN13QP218 = ParametersLiteral + var PN14QP411pq = ParametersLiteral + var PN14QP438 = ParametersLiteral + var PN15QP827pq = ParametersLiteral + var PN15QP880 = 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 NewKeyGenerator(params Parameters) rlwe.KeyGenerator + func NewPublicKey(params Parameters) (pk *rlwe.PublicKey) + func NewRelinearizationKey(params Parameters, maxRelinDegree int) *rlwe.RelinearizationKey + func NewRotationKeySet(params Parameters, galoisElements []uint64) *rlwe.RotationKeySet + func NewSecretKey(params Parameters) (sk *rlwe.SecretKey) + func NewSwitchingKey(params Parameters) *rlwe.SwitchingKey + func Norm(ct *Ciphertext, dec Decryptor) (std, min, max float64) + type Ciphertext struct + func NewCiphertext(params Parameters, degree, level int, scale uint64) (ciphertext *Ciphertext) + func NewCiphertextAtLevelFromPoly(level int, poly [2]*ring.Poly) *Ciphertext + func NewCiphertextRandom(prng utils.PRNG, params Parameters, degree, level int, scale uint64) (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) Scale() uint64 + func (ct *Ciphertext) SetScale(scale uint64) + 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 Encoder interface + DecodeCoeffs func(pt *Plaintext, values []uint64) + DecodeCoeffsNew func(pt *Plaintext) (values []uint64) + DecodeInt func(pt *Plaintext, values []int64) + DecodeIntNew func(pt *Plaintext) (values []int64) + DecodeRingT func(pT *ring.Poly, scale uint64, values interface{}) + DecodeUint func(pt *Plaintext, values []uint64) + DecodeUintNew func(pt *Plaintext) (values []uint64) + Encode func(values interface{}, pt *Plaintext) + EncodeCoeffs func(values []uint64, pt *Plaintext) + EncodeCoeffsNew func(values []uint64, level int, scale uint64) (pt *Plaintext) + EncodeNew func(values interface{}, level int, scale uint64) (pt *Plaintext) + EncodeRingT func(values interface{}, scale uint64, pT *ring.Poly) + RingQ2T func(level int, pQ, pT *ring.Poly) + RingT2Q func(level int, pT, pQ *ring.Poly) + ShallowCopy func() Encoder + func NewEncoder(params Parameters) Encoder + type Encryptor interface + Encrypt func(pt *Plaintext, ct *Ciphertext) + EncryptNew func(pt *Plaintext) *Ciphertext + ShallowCopy func() Encryptor + WithKey func(key interface{}) Encryptor + func NewEncryptor(params Parameters, key interface{}) Encryptor + type Evaluator interface + Add func(ctIn *Ciphertext, op1 Operand, ctOut *Ciphertext) + AddNew func(ctIn *Ciphertext, op1 Operand) (ctOut *Ciphertext) + AddScalar func(ctIn *Ciphertext, scalar uint64, ctOut *Ciphertext) + AddScalarNew func(ctIn *Ciphertext, scalar uint64) (ctOut *Ciphertext) + Automorphism func(ctIn *Ciphertext, galEl uint64, ctOut *Ciphertext) + AutomorphismHoisted func(level int, ctIn *Ciphertext, c1DecompQP []ringqp.Poly, galEl uint64, ...) + BuffQ func() [3]*ring.Poly + DropLevel func(ctIn *Ciphertext, levels int) + DropLevelNew func(ctIn *Ciphertext, levels int) (ctOut *Ciphertext) + EvaluatePoly func(input interface{}, pol *Polynomial, targetScale uint64) (ctOut *Ciphertext, err error) + EvaluatePolyVector func(input interface{}, pols []*Polynomial, encoder Encoder, ...) (ctOut *Ciphertext, err error) + GetRLWEEvaluator func() *rlwe.Evaluator + InnerSumLog func(ctIn *Ciphertext, batch, n int, ctOut *Ciphertext) + LinearTransform func(ctIn *Ciphertext, linearTransform interface{}, ctOut []*Ciphertext) + LinearTransformNew func(ctIn *Ciphertext, linearTransform interface{}) (ctOut []*Ciphertext) + Merge func(ctIn map[int]*Ciphertext) (ctOut *Ciphertext) + Mul func(ctIn *Ciphertext, op1 Operand, ctOut *Ciphertext) + MulAndAdd func(ctIn *Ciphertext, op1 Operand, ctOut *Ciphertext) + MulNew func(ctIn *Ciphertext, op1 Operand) (ctOut *Ciphertext) + MulRelin func(ctIn *Ciphertext, op1 Operand, ctOut *Ciphertext) + MulRelinAndAdd func(ctIn *Ciphertext, op1 Operand, ctOut *Ciphertext) + MulRelinNew func(ctIn *Ciphertext, op1 Operand) (ctOut *Ciphertext) + MulScalar func(ctIn *Ciphertext, scalar uint64, ctOut *Ciphertext) + MulScalarAndAdd func(ctIn *Ciphertext, scalar uint64, ctOut *Ciphertext) + MulScalarNew func(ctIn *Ciphertext, scalar uint64) (ctOut *Ciphertext) + MultiplyByDiagMatrix func(ctIn *Ciphertext, matrix LinearTransform, c2DecompQP []ringqp.Poly, ...) + MultiplyByDiagMatrixBSGS func(ctIn *Ciphertext, matrix LinearTransform, c2DecompQP []ringqp.Poly, ...) + Neg func(ctIn *Ciphertext, ctOut *Ciphertext) + NegNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + Relinearize func(ctIn *Ciphertext, ctOut *Ciphertext) + RelinearizeNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + ReplicateLog func(ctIn *Ciphertext, batch, n int, ctOut *Ciphertext) + Rescale func(ctIn, ctOut *Ciphertext) (err error) + RotateColumns func(ctIn *Ciphertext, k int, ctOut *Ciphertext) + RotateColumnsNew func(ctIn *Ciphertext, k int) (ctOut *Ciphertext) + RotateRows func(ctIn *Ciphertext, ctOut *Ciphertext) + RotateRowsNew func(ctIn *Ciphertext) (ctOut *Ciphertext) + ShallowCopy func() Evaluator + Sub func(ctIn *Ciphertext, op1 Operand, ctOut *Ciphertext) + SubNew func(ctIn *Ciphertext, op1 Operand) (ctOut *Ciphertext) + SwitchKeys func(ctIn *Ciphertext, swk *rlwe.SwitchingKey, ctOut *Ciphertext) + SwitchKeysNew func(ctIn *Ciphertext, swk *rlwe.SwitchingKey) (ctOut *Ciphertext) + WithKey func(rlwe.EvaluationKey) Evaluator + func NewEvaluator(params Parameters, evaluationKey rlwe.EvaluationKey) Evaluator + type LinearTransform struct + Level int + LogSlots int + N1 int + Scale uint64 + Vec map[int]ringqp.Poly + func GenLinearTransform(ecd Encoder, dMat map[int][]uint64, level int, scale uint64) LinearTransform + func GenLinearTransformBSGS(ecd Encoder, dMat map[int][]uint64, level int, scale uint64, BSGSRatio float64) (LT LinearTransform) + func NewLinearTransform(params Parameters, nonZeroDiags []int, level int, BSGSRatio float64) LinearTransform + func (LT *LinearTransform) Encode(ecd Encoder, dMat map[int][]uint64, scale uint64) + func (LT *LinearTransform) Rotations() (rotations []int) + type Operand interface + Degree func() int + El func() *rlwe.Ciphertext + Level func() int + Scale func() uint64 + SetScale func(uint64) + type Parameters struct + func NewParameters(rlweParams rlwe.Parameters, t uint64) (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) Equals(other Parameters) bool + func (p Parameters) LogT() int + func (p Parameters) MarshalBinary() ([]byte, error) + func (p Parameters) MarshalBinarySize() int + func (p Parameters) MarshalJSON() ([]byte, error) + func (p Parameters) RingT() *ring.Ring + func (p Parameters) RotationsForInnerSumLog(batch, n int) (rotations []int) + func (p Parameters) T() uint64 + type ParametersLiteral struct + H int + LogN int + LogP []int + LogQ []int + P []uint64 + Pow2Base int + Q []uint64 + Sigma float64 + T uint64 + func (p ParametersLiteral) RLWEParameters() rlwe.ParametersLiteral + type Plaintext struct + func NewPlaintext(params Parameters, level int, scale uint64) *Plaintext + func NewPlaintextAtLevelFromPoly(level int, poly *ring.Poly) *Plaintext + func (p *Plaintext) Scale() uint64 + func (p *Plaintext) SetScale(scale uint64) + type Polynomial struct + Coeffs []uint64 + Lead bool + MaxDeg int + func NewPoly(coeffs []uint64) (p *Polynomial) + func (p *Polynomial) Degree() int + func (p *Polynomial) Depth() int + type PowerBasis struct + Value map[int]*Ciphertext + func NewPowerBasis(ct *Ciphertext) (p *PowerBasis) + func (p *PowerBasis) GenPower(n int, lazy bool, eval Evaluator) (err error) + func (p *PowerBasis) MarshalBinary() (data []byte, err error) + func (p *PowerBasis) UnmarshalBinary(data []byte) (err error)