Documentation ¶
Overview ¶
Package lintrans implements homomorphic linear transformations for the BFV/BGV schemes.
Index ¶
- func Encode[T bgv.Integer](ecd schemes.Encoder, diagonals Diagonals[T], allocated LinearTransformation) (err error)
- 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 bgv.Integer](ecd schemes.Encoder, diagonals Diagonals[T], allocated LinearTransformation) (err error)
Encode is a method used to encode a LinearTransformation and a wrapper of lintrans.Encode.
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 a struct for evaluating linear transformations on rlwe.Ciphertexts. All fields of this struct are public, enabling custom instantiations.
func NewEvaluator ¶
NewEvaluator instantiates a new Evaluator from a schemes.Evaluator. The default bgv.Evaluator is compliant to the schemes.Evaluator interface.
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.Parameters.
func NewLinearTransformation ¶
func NewLinearTransformation(params rlwe.ParameterProvider, lt Parameters) LinearTransformation
NewLinearTransformation 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 bgv.Integer] [2][]PermutationMapping[T]
Permutation is a struct that defines generic permutations over 2 x n/2 matrices, treating each row independently.
For example, given the 2x2 matrix [[a, b] [c, d]] that would be mapped to [[1b, 2a] [3c, 4d]] then the Permutation would contain the following map: {{0:{1, 2}, 1:{0: 1}}, {0:{0, 3}: 1:{1, 4}}}
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.