forked from tuneinsight/lattigo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckks.go
31 lines (24 loc) · 1.04 KB
/
ckks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Package ckks implements a RNS-accelerated version of the Homomorphic Encryption for Arithmetic for Approximate Numbers
// (HEAAN, a.k.a. CKKS) scheme. It provides approximate arithmetic over the complex numbers.package ckks
package ckks
import (
"github.com/jzhchu/lattigo/rlwe"
)
func NewPlaintext(params Parameters, level int) (pt *rlwe.Plaintext) {
return rlwe.NewPlaintext(params.Parameters, level)
}
func NewCiphertext(params Parameters, degree, level int) (ct *rlwe.Ciphertext) {
return rlwe.NewCiphertext(params.Parameters, degree, level)
}
func NewEncryptor(params Parameters, key interface{}) rlwe.Encryptor {
return rlwe.NewEncryptor(params.Parameters, key)
}
func NewDecryptor(params Parameters, key *rlwe.SecretKey) rlwe.Decryptor {
return rlwe.NewDecryptor(params.Parameters, key)
}
func NewKeyGenerator(params Parameters) rlwe.KeyGenerator {
return rlwe.NewKeyGenerator(params.Parameters)
}
func NewPRNGEncryptor(params Parameters, key *rlwe.SecretKey) rlwe.PRNGEncryptor {
return rlwe.NewPRNGEncryptor(params.Parameters, key)
}