Documentation ¶
Overview ¶
Package lintrans implements homomorphic linear transformations for the CKKS scheme.
Index ¶
- func Encode[T ckks.Float](ecd schemes.Encoder, diagonals Diagonals[T], allocated LinearTransformation) (err error)
- func GaloisElements(params rlwe.ParameterProvider, lt Parameters) (galEls []uint64)
- type Diagonals
- type Evaluator
- func (eval Evaluator) Evaluate(ctIn *rlwe.Ciphertext, linearTransformation LinearTransformation, ...) (err error)
- func (eval Evaluator) EvaluateMany(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation, ...) (err error)
- func (eval Evaluator) EvaluateManyNew(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation) (opOut []*rlwe.Ciphertext, err error)
- func (eval Evaluator) EvaluateNew(ctIn *rlwe.Ciphertext, linearTransformation LinearTransformation) (opOut *rlwe.Ciphertext, err error)
- func (eval Evaluator) EvaluateSequential(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation, ...) (err error)
- func (eval Evaluator) EvaluateSequentialNew(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation) (opOut *rlwe.Ciphertext, err error)
- type LinearTransformation
- type Parameters
- type Permutation
- type PermutationMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
func Encode[T ckks.Float](ecd schemes.Encoder, diagonals Diagonals[T], allocated LinearTransformation) (err error)
Encode is a method used to encode a transformation and a wrapper of lintrans.Encode.
func GaloisElements ¶
func GaloisElements(params rlwe.ParameterProvider, lt Parameters) (galEls []uint64)
GaloisElements returns the list of Galois elements required to evaluate the linear transformation.
Types ¶
type Diagonals ¶
Diagonals is a wrapper of lintrans.Diagonals.
func (Diagonals[T]) DiagonalsIndexList ¶
DiagonalsIndexList returns the list of the non-zero diagonals of the square matrix. A non zero diagonals is a diagonal with a least one non-zero element.
type Evaluator ¶
Evaluator is an evaluator providing an API to evaluate linear transformations on rlwe.Ciphertexts. All fields of this struct are public, enabling custom instantiations.
func NewEvaluator ¶
NewEvaluator instantiates a new Evaluator from a circuit.EvaluatorForLinearTransformation. This method is allocation free.
func (Evaluator) Evaluate ¶
func (eval Evaluator) Evaluate(ctIn *rlwe.Ciphertext, linearTransformation LinearTransformation, opOut *rlwe.Ciphertext) (err error)
Evaluate takes as input a ciphertext ctIn, a linear transformation M and evaluates opOut: M(ctIn).
func (Evaluator) EvaluateMany ¶
func (eval Evaluator) EvaluateMany(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation, opOut []*rlwe.Ciphertext) (err error)
EvaluateMany takes as input a ciphertext ctIn, a list of linear transformations [M0, M1, M2, ...] and a list of pre-allocated receiver opOut and evaluates opOut: [M0(ctIn), M1(ctIn), M2(ctIn), ...]
func (Evaluator) EvaluateManyNew ¶
func (eval Evaluator) EvaluateManyNew(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation) (opOut []*rlwe.Ciphertext, err error)
EvaluateManyNew takes as input a ciphertext ctIn and a list of linear transformations [M0, M1, M2, ...] and returns opOut:[M0(ctIn), M1(ctIn), M2(ctInt), ...].
func (Evaluator) EvaluateNew ¶
func (eval Evaluator) EvaluateNew(ctIn *rlwe.Ciphertext, linearTransformation LinearTransformation) (opOut *rlwe.Ciphertext, err error)
EvaluateNew takes as input a ciphertext ctIn and a linear transformation M and evaluate and returns opOut: M(ctIn).
func (Evaluator) EvaluateSequential ¶
func (eval Evaluator) EvaluateSequential(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation, opOut *rlwe.Ciphertext) (err error)
EvaluateSequential takes as input a ciphertext ctIn and a list of linear transformations [M0, M1, M2, ...] and returns opOut:...M2(M1(M0(ctIn))
func (Evaluator) EvaluateSequentialNew ¶
func (eval Evaluator) EvaluateSequentialNew(ctIn *rlwe.Ciphertext, linearTransformations []LinearTransformation) (opOut *rlwe.Ciphertext, err error)
EvaluateSequentialNew takes as input a ciphertext ctIn and a list of linear transformations [M0, M1, M2, ...] and returns opOut:...M2(M1(M0(ctIn))
type LinearTransformation ¶
type LinearTransformation lintrans.LinearTransformation
LinearTransformation is a wrapper of lintrans.LinearTransformation.
func NewTransformation ¶
func NewTransformation(params rlwe.ParameterProvider, lt Parameters) LinearTransformation
NewTransformation instantiates a new LinearTransformation and is a wrapper of lintrans.LinearTransformation.
func (LinearTransformation) GaloisElements ¶
func (lt LinearTransformation) GaloisElements(params rlwe.ParameterProvider) []uint64
GaloisElements returns the list of Galois elements required to evaluate the linear transformation.
type Parameters ¶
type Parameters lintrans.Parameters
Parameters is a wrapper of lintrans.Parameters.
type Permutation ¶
type Permutation[T ckks.Float] []PermutationMapping[T]
Permutation is a struct that defines generic permutations over vectors.
For example, given the vector [a, b, c, d] that would be mapped to the vector [1b, 2c, 3d, 4a] then the Permutation would contain the following map: {0: {3, 4}, 1:{0, 1}, 2:{1, 2}, 3:{2, 3}}
func (Permutation[T]) GetDiagonals ¶
func (p Permutation[T]) GetDiagonals(logSlots int) Diagonals[T]
GetDiagonals returns the non-zero diagonals of the matrix representation of the permutation, which can be used to instantiate Parameters.