Files
lattigo/bfv/ciphertext.go
Jean-Philippe Bossuat db91eec916 [bfv] added special-purpose plaintexts encodings (#74)
* [bfv] added PlaintextRingT and PlaintextMul types
* [bfv] enhanced bfv.Encoder interface

Co-authored-by: Christian M <christian.mouchet@epfl.ch>
2020-12-11 14:06:55 +01:00

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
}