mirror of
https://github.com/tuneinsight/lattigo.git
synced 2025-09-13 03:27:14 +00:00
* [bfv] added PlaintextRingT and PlaintextMul types * [bfv] enhanced bfv.Encoder interface Co-authored-by: Christian M <christian.mouchet@epfl.ch>
21 lines
758 B
Go
21 lines
758 B
Go
package bfv
|
|
|
|
import "github.com/ldsec/lattigo/v2/utils"
|
|
|
|
// Ciphertext is a *ring.Poly array representing a polynomial of degree > 0 with coefficients in R_Q.
|
|
type Ciphertext struct {
|
|
*Element
|
|
}
|
|
|
|
// NewCiphertext creates a new ciphertext parameterized by degree, level and scale.
|
|
func NewCiphertext(params *Parameters, degree uint64) (ciphertext *Ciphertext) {
|
|
return &Ciphertext{newCiphertextElement(params, degree)}
|
|
}
|
|
|
|
// NewCiphertextRandom generates a new uniformly distributed ciphertext of degree, level and scale.
|
|
func NewCiphertextRandom(prng utils.PRNG, params *Parameters, degree uint64) (ciphertext *Ciphertext) {
|
|
ciphertext = &Ciphertext{newCiphertextElement(params, degree)}
|
|
populateElementRandom(prng, params, ciphertext.Element)
|
|
return
|
|
}
|