mirror of
https://github.com/tuneinsight/lattigo.git
synced 2025-09-13 03:27:14 +00:00
21 lines
678 B
Go
21 lines
678 B
Go
package bfv
|
|
|
|
import "github.com/ldsec/lattigo/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{NewElement(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) {
|
|
|
|
return &Ciphertext{NewElementRandom(prng, params, degree)}
|
|
}
|