Documentation
¶
Index ¶
- func CPComputeHankelMatrix(items []*big.Int, u *big.Int, setting AHE_setting) (H gm.Matrix, err error)
- func CentralASSWorker(a Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
- func CentralBFVEncryptionGenerator(channels []chan interface{}) (BFV_encryption, BFV_secret_key)
- func CentralCardinalityTestWorker(items []*big.Int, sk Secret_key, setting AHE_setting) bool
- func CentralDecryptionWorker(cipher Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
- func CentralFHECardinalityTestWorker(items []*big.Int, sk Secret_key, setting FHE_setting) bool
- func CentralHankelMatrix(items []*big.Int, sk Secret_key, setting AHE_setting) gm.Matrix
- func CentralIntersectionPolyWorker(root_poly gm.Matrix, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
- func CentralMatrixMultiplicationWorker(a, b gm.Matrix, sk Secret_key, setting AHE_setting) gm.Matrix
- func CentralMinPolyWorker(seq gm.Matrix, rec_ord int, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
- func CentralSingularityTestWorker(m gm.Matrix, sk Secret_key, setting AHE_setting) bool
- func CentralZeroTestWorker(a Ciphertext, sk Secret_key, setting AHE_setting) bool
- func CombineMatrixMultiplication(MA_enc, MB_enc gm.Matrix, MAis, MBis []gm.Matrix, ctis []gm.Matrix, ...) (AB gm.Matrix, err error)
- func CombineMatrixShares(part_mat []gm.Matrix, enc_mat gm.Matrix, setting AHE_setting) (decrypted gm.Matrix, err error)
- func ComputeHankelMatrix(items []*big.Int, u *big.Int, setting AHE_setting) (gm.Matrix, error)
- func ComputePlainHankelMatrix(items []*big.Int, u *big.Int, setting AHE_setting) gm.Matrix
- func DecodeElements(elements []*big.Int) []*big.Int
- func EncodeElements(elements []*big.Int) []*big.Int
- func EncryptMatrix(a gm.Matrix, setting AHE_setting) (b gm.Matrix, err error)
- func EncryptedOneMatrix(rows, cols int, setting AHE_setting) (m gm.Matrix, err error)
- func EncryptedZeroMatrix(rows, cols int, setting AHE_setting) (m gm.Matrix, err error)
- func EvalIntPolys(root_poly gm.Matrix, sample_max int, setting AHE_setting) (R_values_enc, R_tilde_values, p_values gm.Matrix)
- func EvalPoly(p gm.Matrix, x, mod *big.Int) *big.Int
- func GenCRP(params *bfv.Parameters) (*ring.Poly, []*ring.Poly)
- func GetCti(MA, MB, RA, RAi, RBi gm.Matrix, setting AHE_setting, Secret_key Secret_key) (cti gm.Matrix, MA_part, MB_part gm.Matrix, err error)
- func GetMulMatrices(A, B gm.Matrix, RAs, RBs []gm.Matrix, setting AHE_setting) (RA, MA, MB gm.Matrix, err error)
- func HSeq(Hvs gm.Matrix, mat_size int, setting AHE_setting) (h_seq gm.Matrix, err error)
- func Interpolation(vs, ps gm.Matrix, setting AHE_setting) gm.Matrix
- func IntersectionWorker(items []*big.Int, sk Secret_key, setting AHE_setting) ([]*big.Int, []*big.Int)
- func IsRoot(poly gm.Matrix, x *big.Int, mod *big.Int) bool
- func MaskH(Hs gm.Matrix, HMasks []gm.Matrix, setting AHE_setting) (diff gm.Matrix, err error)
- func MaskRootPoly(p_values, party_values, R_tilde_values gm.Matrix, sample_max int, ...) gm.Matrix
- func MultPoly(p1, p2 gm.Matrix) gm.Matrix
- func NbrMMultInstances(m gm.Matrix) int
- func NegateValue(d *big.Int, setting AHE_setting) *big.Int
- func NewCustomDJCryptosystem(n, bitSize, s int) (cryptosystem DJ_encryption, secret_keys []DJ_secret_key, err error)
- func NewDJCryptosystem(n int) (cryptosystem DJ_encryption, secret_keys []DJ_secret_key, err error)
- func OuterASSWorker(a Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
- func OuterBFVEncryptionGenerator(channel chan interface{}) (BFV_encryption, BFV_secret_key)
- func OuterCardinalityTestWorker(items []*big.Int, sk Secret_key, setting AHE_setting) bool
- func OuterDecryptionWorker(cipher Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
- func OuterFHECardinalityTestWorker(items []*big.Int, sk Secret_key, setting FHE_setting) bool
- func OuterHankelMatrix(items []*big.Int, sk Secret_key, setting AHE_setting) gm.Matrix
- func OuterIntersectionPolyWorker(root_poly gm.Matrix, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
- func OuterMatrixMultiplicationWorker(a, b gm.Matrix, sk Secret_key, setting AHE_setting) gm.Matrix
- func OuterMinPolyWorker(seq gm.Matrix, rec_ord int, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
- func OuterSingularityTestWorker(m gm.Matrix, sk Secret_key, setting AHE_setting) bool
- func OuterZeroTestWorker(a Ciphertext, sk Secret_key, setting AHE_setting) bool
- func PartialDecryptMatrix(cipher gm.Matrix, Secret_key Secret_key) (part_mat gm.Matrix, err error)
- func PolyFromRoots(roots []*big.Int, mod *big.Int) gm.Matrix
- func PolyMult(a_num, a_den, b_num, b_den gm.Matrix, sk Secret_key, setting AHE_setting) (prod_num, prod_den gm.Matrix, err error)
- func PolySub(a_num, a_den, b_num, b_den gm.Matrix, sk Secret_key, setting AHE_setting) (diff_num, diff_den gm.Matrix, err error)
- func RootMask(root_poly gm.Matrix, setting AHE_setting) gm.Matrix
- func SampleHMasks(setting AHE_setting)
- func SampleInt(q *big.Int) (*big.Int, error)
- func SampleMatrix(rows, cols int, q *big.Int) (a gm.Matrix, err error)
- func SampleRMatrices(a, b gm.Matrix, setting AHE_setting) (RAi_plain, RAi_enc, RBi_plain, RBi_enc gm.Matrix, err error)
- func SampleSlice(l int, q *big.Int) (a []*big.Int, err error)
- func SampleUVector(m gm.Matrix, setting AHE_setting) (u gm.Matrix, err error)
- func SampleVVector(m gm.Matrix, setting AHE_setting) (v gm.Matrix, err error)
- func SecretShare(d, e *big.Int, setting AHE_setting) *big.Int
- func SetupBFV(n int) ([]BFV_encryption, []BFV_secret_key)
- func TPSIdiffWorker(items []*big.Int, sk Secret_key, setting AHE_setting) ([]*big.Int, []*big.Int)
- func TPSIintWorker(items []*big.Int, sk Secret_key, setting FHE_setting) ([]*big.Int, []*big.Int)
- type AHESetting
- func (s AHESetting) AHE_cryptosystem() AHE_Cryptosystem
- func (s AHESetting) Distribute(any interface{})
- func (s AHESetting) IsCentral() bool
- func (s AHESetting) Parties() int
- func (s AHESetting) Receive() interface{}
- func (s AHESetting) ReceiveAll() []interface{}
- func (s AHESetting) Send(any interface{})
- func (s AHESetting) SendTo(i int, any interface{})
- func (s AHESetting) Threshold() int
- type AHE_Cryptosystem
- type AHE_setting
- type BFV_ciphertext
- type BFV_encryption
- func (pk BFV_encryption) Add(a, b Ciphertext) (sum Ciphertext, err error)
- func (pk BFV_encryption) CombinePartials(parts []Partial_decryption) (*big.Int, error)
- func (pk BFV_encryption) Encrypt(a *big.Int) (Ciphertext, error)
- func (pk BFV_encryption) EvaluationSpace() gm.Space
- func (pk BFV_encryption) Multiply(a, b Ciphertext) (product Ciphertext, err error)
- func (pk BFV_encryption) N() *big.Int
- func (pk BFV_encryption) Scale(cipher Ciphertext, factor *big.Int) (product Ciphertext, err error)
- type BFV_eval_space
- func (pk BFV_eval_space) Add(a, b interface{}) (interface{}, error)
- func (pk BFV_eval_space) Multiply(a, b interface{}) (product interface{}, err error)
- func (pk BFV_eval_space) Scalarspace() bool
- func (pk BFV_eval_space) Scale(ciphertext interface{}, factor interface{}) (product interface{}, err error)
- func (pk BFV_eval_space) Subtract(a, b interface{}) (diff interface{}, err error)
- type BFV_init
- type BFV_partial
- type BFV_secret_key
- type Ciphertext
- func CentralInverseWorker(a Ciphertext, sk Secret_key, setting FHE_setting) Ciphertext
- func CentralInverseWorkerWithFactor(a Ciphertext, factor *big.Int, sk Secret_key, setting FHE_setting) Ciphertext
- func CentralMultWorker(a, b Ciphertext, sk Secret_key, setting AHE_setting) Ciphertext
- func FHEEvaluate(x *big.Int, poly []Ciphertext, setting FHE_setting) Ciphertext
- func FHEInterpolation(q []Ciphertext, sk Secret_key, setting FHE_setting) []Ciphertext
- func GetRandomEncrypted(setting AHE_setting) (plain *big.Int, cipher Ciphertext, err error)
- func OuterInverseWorker(a Ciphertext, sk Secret_key, setting FHE_setting) Ciphertext
- func OuterInverseWorkerWithFactor(a Ciphertext, factor *big.Int, sk Secret_key, setting FHE_setting) Ciphertext
- func OuterMultWorker(a, b Ciphertext, sk Secret_key, setting AHE_setting) Ciphertext
- func PolynomialDivisionWorker(a, b gm.Matrix, a_den, b_den Ciphertext, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix, gm.Matrix, Ciphertext)
- func SumSlice(values []Ciphertext, setting AHE_setting) (sum Ciphertext, err error)
- type DJ_ds
- type DJ_encryption
- func (pk DJ_encryption) Add(a, b Ciphertext) (sum Ciphertext, err error)
- func (pk DJ_encryption) CombinePartials(parts []Partial_decryption) (plaintext *big.Int, err error)
- func (pk DJ_encryption) Encrypt(plaintext *big.Int) (ciphertext Ciphertext, err error)
- func (pk DJ_encryption) EvaluationSpace() gm.Space
- func (pk DJ_encryption) N() *big.Int
- func (pk DJ_encryption) Scale(cipher Ciphertext, factor *big.Int) (Ciphertext, error)
- type DJ_secret_key
- type FHESetting
- type FHE_Cryptosystem
- type FHE_setting
- type Partial_decryption
- type Secret_key
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CPComputeHankelMatrix ¶
func CPComputeHankelMatrix(items []*big.Int, u *big.Int, setting AHE_setting) (H gm.Matrix, err error)
compute the encrypted Hankel Matrix for central party
func CentralASSWorker ¶
func CentralASSWorker(a Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
func CentralBFVEncryptionGenerator ¶
func CentralBFVEncryptionGenerator(channels []chan interface{}) (BFV_encryption, BFV_secret_key)
func CentralCardinalityTestWorker ¶
func CentralCardinalityTestWorker(items []*big.Int, sk Secret_key, setting AHE_setting) bool
returns true if number of elements not shared by all is <= setting.Threshold()
func CentralDecryptionWorker ¶
func CentralDecryptionWorker(cipher Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
func CentralFHECardinalityTestWorker ¶
func CentralFHECardinalityTestWorker(items []*big.Int, sk Secret_key, setting FHE_setting) bool
returns true if cardinality test passes
func CentralHankelMatrix ¶
func CentralHankelMatrix(items []*big.Int, sk Secret_key, setting AHE_setting) gm.Matrix
func CentralIntersectionPolyWorker ¶
func CentralIntersectionPolyWorker(root_poly gm.Matrix, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
step 3 of TPSI-diff
func CentralMatrixMultiplicationWorker ¶
func CentralMatrixMultiplicationWorker(a, b gm.Matrix, sk Secret_key, setting AHE_setting) gm.Matrix
func CentralMinPolyWorker ¶
func CentralMinPolyWorker(seq gm.Matrix, rec_ord int, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
func CentralSingularityTestWorker ¶
func CentralSingularityTestWorker(m gm.Matrix, sk Secret_key, setting AHE_setting) bool
returns true if m is singular
func CentralZeroTestWorker ¶
func CentralZeroTestWorker(a Ciphertext, sk Secret_key, setting AHE_setting) bool
func CombineMatrixMultiplication ¶
func CombineMatrixMultiplication(MA_enc, MB_enc gm.Matrix, MAis, MBis []gm.Matrix, ctis []gm.Matrix, setting AHE_setting) (AB gm.Matrix, err error)
step 4 of MMult
func CombineMatrixShares ¶
func CombineMatrixShares(part_mat []gm.Matrix, enc_mat gm.Matrix, setting AHE_setting) (decrypted gm.Matrix, err error)
combine partial matrix decryptions to receive plaintext matrix
func ComputeHankelMatrix ¶
compute and encrypt the Hankel Matrix for items and (random) u.
func ComputePlainHankelMatrix ¶
compute the Hankel Matrix for items and (random) u.
func EncryptMatrix ¶
encrypt matrix item-wise
func EncryptedOneMatrix ¶
func EncryptedOneMatrix(rows, cols int, setting AHE_setting) (m gm.Matrix, err error)
func EncryptedZeroMatrix ¶
func EncryptedZeroMatrix(rows, cols int, setting AHE_setting) (m gm.Matrix, err error)
func EvalIntPolys ¶
func GetCti ¶
func GetCti(MA, MB, RA, RAi, RBi gm.Matrix, setting AHE_setting, Secret_key Secret_key) (cti gm.Matrix, MA_part, MB_part gm.Matrix, err error)
step 3 of MMult
func GetMulMatrices ¶
func GetMulMatrices(A, B gm.Matrix, RAs, RBs []gm.Matrix, setting AHE_setting) (RA, MA, MB gm.Matrix, err error)
step 2 of MMult
func Interpolation ¶
func Interpolation(vs, ps gm.Matrix, setting AHE_setting) gm.Matrix
step 4 of TPSI-diff
func IntersectionWorker ¶
func IntersectionWorker(items []*big.Int, sk Secret_key, setting AHE_setting) ([]*big.Int, []*big.Int)
returns two slices, shared elements & unique elements
func MaskRootPoly ¶
func NbrMMultInstances ¶
calculates how many instances of MMult is needed to get all H, according to: n = ceil( log(matrix size) ) H^2^n being the highest order needed
func NewCustomDJCryptosystem ¶
func NewCustomDJCryptosystem(n, bitSize, s int) (cryptosystem DJ_encryption, secret_keys []DJ_secret_key, err error)
func NewDJCryptosystem ¶
func NewDJCryptosystem(n int) (cryptosystem DJ_encryption, secret_keys []DJ_secret_key, err error)
func OuterASSWorker ¶
func OuterASSWorker(a Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
func OuterBFVEncryptionGenerator ¶
func OuterBFVEncryptionGenerator(channel chan interface{}) (BFV_encryption, BFV_secret_key)
func OuterCardinalityTestWorker ¶
func OuterCardinalityTestWorker(items []*big.Int, sk Secret_key, setting AHE_setting) bool
returns true if number of elements not shared by all is <= setting.Threshold()
func OuterDecryptionWorker ¶
func OuterDecryptionWorker(cipher Ciphertext, sk Secret_key, setting AHE_setting) *big.Int
func OuterFHECardinalityTestWorker ¶
func OuterFHECardinalityTestWorker(items []*big.Int, sk Secret_key, setting FHE_setting) bool
returns true if cardinality test passes
func OuterHankelMatrix ¶
func OuterHankelMatrix(items []*big.Int, sk Secret_key, setting AHE_setting) gm.Matrix
func OuterIntersectionPolyWorker ¶
func OuterIntersectionPolyWorker(root_poly gm.Matrix, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
step 3 of TPSI-diff
func OuterMatrixMultiplicationWorker ¶
func OuterMatrixMultiplicationWorker(a, b gm.Matrix, sk Secret_key, setting AHE_setting) gm.Matrix
func OuterMinPolyWorker ¶
func OuterMinPolyWorker(seq gm.Matrix, rec_ord int, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix)
func OuterSingularityTestWorker ¶
func OuterSingularityTestWorker(m gm.Matrix, sk Secret_key, setting AHE_setting) bool
returns true if m is singular
func OuterZeroTestWorker ¶
func OuterZeroTestWorker(a Ciphertext, sk Secret_key, setting AHE_setting) bool
func PartialDecryptMatrix ¶
perform partial decryption for key share Secret_key
func PolyMult ¶
func PolyMult(a_num, a_den, b_num, b_den gm.Matrix, sk Secret_key, setting AHE_setting) (prod_num, prod_den gm.Matrix, err error)
func PolySub ¶
func PolySub(a_num, a_den, b_num, b_den gm.Matrix, sk Secret_key, setting AHE_setting) (diff_num, diff_den gm.Matrix, err error)
func SampleMatrix ¶
sample a matrix with size rows x cols, with elements from field defined by q
func SampleRMatrices ¶
func SampleRMatrices(a, b gm.Matrix, setting AHE_setting) (RAi_plain, RAi_enc, RBi_plain, RBi_enc gm.Matrix, err error)
step 1 of MMult
func SampleUVector ¶
sample u from step 3e of CTest-diff
func SampleVVector ¶
step 3b of CTest-diff
func SetupBFV ¶
func SetupBFV(n int) ([]BFV_encryption, []BFV_secret_key)
func TPSIdiffWorker ¶
func TPSIdiffWorker(items []*big.Int, sk Secret_key, setting AHE_setting) ([]*big.Int, []*big.Int)
returns two slices: shared elements & unique elements if cardinality test passes, otherwise nil, nil
func TPSIintWorker ¶
func TPSIintWorker(items []*big.Int, sk Secret_key, setting FHE_setting) ([]*big.Int, []*big.Int)
returns two slices: shared elements & unique elements if cardinality test passes, otherwise nil, nil
Types ¶
type AHESetting ¶
type AHESetting struct {
T int // threshold
// contains filtered or unexported fields
}
func SetupAHE ¶
func SetupAHE(n, T int, cs AHE_Cryptosystem) []AHESetting
func (AHESetting) AHE_cryptosystem ¶
func (s AHESetting) AHE_cryptosystem() AHE_Cryptosystem
func (AHESetting) Distribute ¶
func (s AHESetting) Distribute(any interface{})
func (AHESetting) IsCentral ¶
func (s AHESetting) IsCentral() bool
func (AHESetting) Parties ¶
func (s AHESetting) Parties() int
func (AHESetting) Receive ¶
func (s AHESetting) Receive() interface{}
func (AHESetting) ReceiveAll ¶
func (s AHESetting) ReceiveAll() []interface{}
func (AHESetting) Send ¶
func (s AHESetting) Send(any interface{})
func (AHESetting) SendTo ¶
func (s AHESetting) SendTo(i int, any interface{})
func (AHESetting) Threshold ¶
func (s AHESetting) Threshold() int
type AHE_Cryptosystem ¶
type AHE_Cryptosystem interface {
// addition of two elements
Add(Ciphertext, Ciphertext) (sum Ciphertext, err error)
// scaling of an element by scalar factor
Scale(cipher Ciphertext, factor *big.Int) (product Ciphertext, err error)
// encrypt a plaintext message
Encrypt(*big.Int) (Ciphertext, error)
// combine partial decryptions to plaintext
CombinePartials([]Partial_decryption) (*big.Int, error)
// encrypted matrix evaluation
EvaluationSpace() gm.Space
// size of plaintext space
N() *big.Int
}
type AHE_setting ¶
type AHE_setting interface {
// threshold value
Threshold() int
// numer of parties
Parties() int
// ahe cryptosystem
AHE_cryptosystem() AHE_Cryptosystem
// used by central party to send a value to all
Distribute(interface{})
// used by outer parties to send to central party
Send(interface{})
// used by central party to send
// a message to given party
SendTo(int, interface{})
// for central to await messages from all
// and get them (ordered) in a slice
ReceiveAll() []interface{}
// receive a message from central party
Receive() interface{}
// true if this party is central
IsCentral() bool
}
type BFV_ciphertext ¶
type BFV_ciphertext struct {
// contains filtered or unexported fields
}
func CentralRefresh ¶
func CentralRefresh(cipher BFV_ciphertext, pk BFV_encryption) BFV_ciphertext
func OuterRefresh ¶
func OuterRefresh(cipher BFV_ciphertext, pk BFV_encryption) BFV_ciphertext
type BFV_encryption ¶
type BFV_encryption struct {
// contains filtered or unexported fields
}
func CentralKeyGenerator ¶
func CentralKeyGenerator(init BFV_init, channels []chan interface{}) (BFV_encryption, *bfv.SecretKey)
func OuterKeyGenerator ¶
func OuterKeyGenerator(init BFV_init, channel chan interface{}) (BFV_encryption, *bfv.SecretKey)
func (BFV_encryption) Add ¶
func (pk BFV_encryption) Add(a, b Ciphertext) (sum Ciphertext, err error)
func (BFV_encryption) CombinePartials ¶
func (pk BFV_encryption) CombinePartials(parts []Partial_decryption) (*big.Int, error)
func (BFV_encryption) Encrypt ¶
func (pk BFV_encryption) Encrypt(a *big.Int) (Ciphertext, error)
func (BFV_encryption) EvaluationSpace ¶
func (pk BFV_encryption) EvaluationSpace() gm.Space
func (BFV_encryption) Multiply ¶
func (pk BFV_encryption) Multiply(a, b Ciphertext) (product Ciphertext, err error)
func (BFV_encryption) N ¶
func (pk BFV_encryption) N() *big.Int
func (BFV_encryption) Scale ¶
func (pk BFV_encryption) Scale(cipher Ciphertext, factor *big.Int) (product Ciphertext, err error)
type BFV_eval_space ¶
type BFV_eval_space struct {
BFV_encryption
}
func (BFV_eval_space) Add ¶
func (pk BFV_eval_space) Add(a, b interface{}) (interface{}, error)
func (BFV_eval_space) Multiply ¶
func (pk BFV_eval_space) Multiply(a, b interface{}) (product interface{}, err error)
func (BFV_eval_space) Scalarspace ¶
func (pk BFV_eval_space) Scalarspace() bool
func (BFV_eval_space) Scale ¶
func (pk BFV_eval_space) Scale(ciphertext interface{}, factor interface{}) (product interface{}, err error)
func (BFV_eval_space) Subtract ¶
func (pk BFV_eval_space) Subtract(a, b interface{}) (diff interface{}, err error)
type BFV_partial ¶
type BFV_partial struct {
// contains filtered or unexported fields
}
type BFV_secret_key ¶
type BFV_secret_key struct {
// contains filtered or unexported fields
}
func (BFV_secret_key) PartialDecrypt ¶
func (sk BFV_secret_key) PartialDecrypt(ciphertext Ciphertext) (Partial_decryption, error)
type Ciphertext ¶
type Ciphertext interface{}
func CentralInverseWorker ¶
func CentralInverseWorker(a Ciphertext, sk Secret_key, setting FHE_setting) Ciphertext
func CentralInverseWorkerWithFactor ¶
func CentralInverseWorkerWithFactor(a Ciphertext, factor *big.Int, sk Secret_key, setting FHE_setting) Ciphertext
func CentralMultWorker ¶
func CentralMultWorker(a, b Ciphertext, sk Secret_key, setting AHE_setting) Ciphertext
func FHEEvaluate ¶
func FHEEvaluate(x *big.Int, poly []Ciphertext, setting FHE_setting) Ciphertext
func FHEInterpolation ¶
func FHEInterpolation(q []Ciphertext, sk Secret_key, setting FHE_setting) []Ciphertext
func GetRandomEncrypted ¶
func GetRandomEncrypted(setting AHE_setting) (plain *big.Int, cipher Ciphertext, err error)
ASS, step 1
func OuterInverseWorker ¶
func OuterInverseWorker(a Ciphertext, sk Secret_key, setting FHE_setting) Ciphertext
func OuterInverseWorkerWithFactor ¶
func OuterInverseWorkerWithFactor(a Ciphertext, factor *big.Int, sk Secret_key, setting FHE_setting) Ciphertext
func OuterMultWorker ¶
func OuterMultWorker(a, b Ciphertext, sk Secret_key, setting AHE_setting) Ciphertext
func PolynomialDivisionWorker ¶
func PolynomialDivisionWorker(a, b gm.Matrix, a_den, b_den Ciphertext, sk Secret_key, setting AHE_setting) (gm.Matrix, gm.Matrix, gm.Matrix, Ciphertext)
returns:
- q numerator
- q denominator
- r numerator
- r denominator
func SumSlice ¶
func SumSlice(values []Ciphertext, setting AHE_setting) (sum Ciphertext, err error)
Mult, step 6
type DJ_encryption ¶
type DJ_encryption struct {
gm.DJ_public_key
}
func (DJ_encryption) Add ¶
func (pk DJ_encryption) Add(a, b Ciphertext) (sum Ciphertext, err error)
func (DJ_encryption) CombinePartials ¶
func (pk DJ_encryption) CombinePartials(parts []Partial_decryption) (plaintext *big.Int, err error)
func (DJ_encryption) Encrypt ¶
func (pk DJ_encryption) Encrypt(plaintext *big.Int) (ciphertext Ciphertext, err error)
func (DJ_encryption) EvaluationSpace ¶
func (pk DJ_encryption) EvaluationSpace() gm.Space
func (DJ_encryption) N ¶
func (pk DJ_encryption) N() *big.Int
func (DJ_encryption) Scale ¶
func (pk DJ_encryption) Scale(cipher Ciphertext, factor *big.Int) (Ciphertext, error)
type DJ_secret_key ¶
type DJ_secret_key struct {
}
func (DJ_secret_key) PartialDecrypt ¶
func (sk DJ_secret_key) PartialDecrypt(ciphertext Ciphertext) (Partial_decryption, error)
type FHESetting ¶
type FHESetting struct {
AHESetting
// contains filtered or unexported fields
}
func SetupFHE ¶
func SetupFHE(n, T int, cs []FHE_Cryptosystem) []FHESetting
func (FHESetting) AHE_cryptosystem ¶
func (s FHESetting) AHE_cryptosystem() AHE_Cryptosystem
func (FHESetting) FHE_cryptosystem ¶
func (s FHESetting) FHE_cryptosystem() FHE_Cryptosystem
type FHE_Cryptosystem ¶
type FHE_Cryptosystem interface {
AHE_Cryptosystem
// multiplication of two elements
Multiply(Ciphertext, Ciphertext) (Ciphertext, error)
}
type FHE_setting ¶
type FHE_setting interface {
AHE_setting
// fhe cryptosystem
FHE_cryptosystem() FHE_Cryptosystem
}
type Partial_decryption ¶
type Partial_decryption interface{}
func SumMasksDecrypt ¶
func SumMasksDecrypt(a Ciphertext, ds []Ciphertext, sk Secret_key, setting AHE_setting) (e_partial Partial_decryption, err error)
ASS, step 5 & 6
type Secret_key ¶
type Secret_key interface {
PartialDecrypt(Ciphertext) (Partial_decryption, error)
}