Documentation
¶
Overview ¶
Package mhe implements RLWE-based scheme agnostic multiparty key-generation and proxy re-rencryption. See README.md for more details about multiparty homomorphic encryption.
Index ¶
- func NoiseCircularCiphertext(params rlwe.Parameters, hasP bool, d, Log2Basis, nbParties int) (std float64)
- func NoiseEvaluationKey(params rlwe.Parameters, nbParties int) (std float64)
- func NoiseGadgetCiphertext(params rlwe.Parameters, nbParties int) (std float64)
- func NoiseGaloisKey(params rlwe.Parameters, nbParties int) (std float64)
- func NoiseKeySwitch(nbParties int, noisect, noisefresh, noiseflood float64) (std float64)
- func NoiseRelinearizationKey(params rlwe.Parameters, nbParties int) (std float64)
- type AdditiveShare
- type AdditiveShareBigint
- type CircularCiphertextProtocol
- func (p CircularCiphertextProtocol) Aggregate(share1, share2, share3 *CircularCiphertextShare) (err error)
- func (p CircularCiphertextProtocol) Allocate() *CircularCiphertextShare
- func (p CircularCiphertextProtocol) Finalize(share *CircularCiphertextShare, ctU *rlwe.GadgetCiphertext, ...) (err error)
- func (p CircularCiphertextProtocol) Gen(sk, u *rlwe.SecretKey, pt *rlwe.Plaintext, seed [32]byte, ...) (err error)
- func (p CircularCiphertextProtocol) GenEphemeralSecret(sk *rlwe.SecretKey, seed [32]byte, DDGRLWE rlwe.DigitDecomposition) (u *rlwe.SecretKey, share *GadgetCiphertextShare, err error)
- func (p CircularCiphertextProtocol) ShallowCopy() *CircularCiphertextProtocol
- type CircularCiphertextShare
- func (share CircularCiphertextShare) BinarySize() int
- func (share CircularCiphertextShare) Equal(other *CircularCiphertextShare) bool
- func (share CircularCiphertextShare) MarshalBinary() (p []byte, err error)
- func (share *CircularCiphertextShare) ReadFrom(r io.Reader) (n int64, err error)
- func (share *CircularCiphertextShare) UnmarshalBinary(p []byte) (err error)
- func (share CircularCiphertextShare) WriteTo(w io.Writer) (n int64, err error)
- type CircularGadgetCiphertextProtocol
- func (p CircularGadgetCiphertextProtocol) Aggregate(share1, share2, share3 *CircularGadgetCiphertextShare) (err error)
- func (p CircularGadgetCiphertextProtocol) Allocate(dd rlwe.DigitDecomposition) *CircularGadgetCiphertextShare
- func (p CircularGadgetCiphertextProtocol) Finalize(share *CircularGadgetCiphertextShare, ctu *rlwe.GadgetCiphertext, ...) (err error)
- func (p CircularGadgetCiphertextProtocol) FinalizeNew(share *CircularGadgetCiphertextShare, ctu *rlwe.GadgetCiphertext) (ctMS *rlwe.GadgetCiphertext, err error)
- func (p CircularGadgetCiphertextProtocol) Gen(sk, u *rlwe.SecretKey, pt *rlwe.Plaintext, seed [32]byte, ...) (err error)
- func (p CircularGadgetCiphertextProtocol) GenEphemeralSecret(sk *rlwe.SecretKey, seed [32]byte, DDGRLWE rlwe.DigitDecomposition) (u *rlwe.SecretKey, share *GadgetCiphertextShare, err error)
- func (p CircularGadgetCiphertextProtocol) ShallowCopy() *CircularGadgetCiphertextProtocol
- type CircularGadgetCiphertextShare
- func (share CircularGadgetCiphertextShare) BinarySize() int
- func (share CircularGadgetCiphertextShare) Equal(other *CircularGadgetCiphertextShare) bool
- func (share CircularGadgetCiphertextShare) MarshalBinary() (p []byte, err error)
- func (share *CircularGadgetCiphertextShare) ReadFrom(r io.Reader) (n int64, err error)
- func (share *CircularGadgetCiphertextShare) UnmarshalBinary(p []byte) (err error)
- func (share CircularGadgetCiphertextShare) WriteTo(w io.Writer) (n int64, err error)
- type Combiner
- type EvaluationKeyProtocol
- func (p EvaluationKeyProtocol) Aggregate(share1, share2, share3 *EvaluationKeyShare) (err error)
- func (p EvaluationKeyProtocol) Allocate(evkParams ...rlwe.EvaluationKeyParameters) *EvaluationKeyShare
- func (p EvaluationKeyProtocol) Finalize(share *EvaluationKeyShare, evk *rlwe.EvaluationKey) (err error)
- func (p EvaluationKeyProtocol) FinalizeNew(share *EvaluationKeyShare) (evk *rlwe.EvaluationKey)
- func (p EvaluationKeyProtocol) Gen(skIn, skOut *rlwe.SecretKey, seed [32]byte, share *EvaluationKeyShare) (err error)
- func (p EvaluationKeyProtocol) ShallowCopy() *EvaluationKeyProtocol
- type EvaluationKeyShare
- func (share *EvaluationKeyShare) Aggregate(params rlwe.ParameterProvider, a, b *EvaluationKeyShare) (err error)
- func (share EvaluationKeyShare) AsEvaluationKey(params rlwe.ParameterProvider) (evk *rlwe.EvaluationKey)
- func (share EvaluationKeyShare) Equal(other *EvaluationKeyShare) bool
- func (share EvaluationKeyShare) Get(params rlwe.ParameterProvider, evk *rlwe.EvaluationKey) (err error)
- func (share EvaluationKeyShare) GetNew(params rlwe.ParameterProvider) (evk *rlwe.EvaluationKey)
- type GadgetCiphertextProtocol
- func (p GadgetCiphertextProtocol) Aggregate(share1, share2, share3 *GadgetCiphertextShare) (err error)
- func (p GadgetCiphertextProtocol) Allocate(LevelQ, LevelP int, DD rlwe.DigitDecomposition) *GadgetCiphertextShare
- func (p GadgetCiphertextProtocol) Finalize(share *GadgetCiphertextShare, ct *rlwe.GadgetCiphertext) (err error)
- func (p GadgetCiphertextProtocol) Gen(sk *rlwe.SecretKey, pt *rlwe.Plaintext, seed [32]byte, ...) (err error)
- func (p GadgetCiphertextProtocol) ShallowCopy() *GadgetCiphertextProtocol
- type GadgetCiphertextShare
- func (share *GadgetCiphertextShare) Aggregate(params rlwe.ParameterProvider, a, b *GadgetCiphertextShare) (err error)
- func (share GadgetCiphertextShare) AsGadgetCiphertext(params rlwe.ParameterProvider) (gct *rlwe.GadgetCiphertext)
- func (share GadgetCiphertextShare) BinarySize() (dataLen int)
- func (share GadgetCiphertextShare) Equal(other *GadgetCiphertextShare) bool
- func (share GadgetCiphertextShare) Get(params rlwe.ParameterProvider, gct *rlwe.GadgetCiphertext) (err error)
- func (share GadgetCiphertextShare) GetNew(params rlwe.ParameterProvider) (gct *rlwe.GadgetCiphertext)
- func (share GadgetCiphertextShare) MarshalBinary() (data []byte, err error)
- func (share *GadgetCiphertextShare) ReadFrom(r io.Reader) (n int64, err error)
- func (share *GadgetCiphertextShare) UnmarshalBinary(p []byte) (err error)
- func (share GadgetCiphertextShare) WriteTo(w io.Writer) (n int64, err error)
- type GaloisKeyProtocol
- func (p GaloisKeyProtocol) Aggregate(share1, share2, share3 *GaloisKeyShare) (err error)
- func (p GaloisKeyProtocol) Allocate(evkParams ...rlwe.EvaluationKeyParameters) (pShare *GaloisKeyShare)
- func (p GaloisKeyProtocol) Finalize(share *GaloisKeyShare, gk *rlwe.GaloisKey) (err error)
- func (p GaloisKeyProtocol) FinalizeNew(share *GaloisKeyShare) (gk *rlwe.GaloisKey)
- func (p GaloisKeyProtocol) Gen(sk *rlwe.SecretKey, galEl uint64, seed [32]byte, share *GaloisKeyShare) (err error)
- func (p GaloisKeyProtocol) ShallowCopy() *GaloisKeyProtocol
- type GaloisKeyShare
- func (share GaloisKeyShare) BinarySize() int
- func (share GaloisKeyShare) Equal(other *GaloisKeyShare) bool
- func (share GaloisKeyShare) MarshalBinary() (p []byte, err error)
- func (share *GaloisKeyShare) ReadFrom(r io.Reader) (n int64, err error)
- func (share *GaloisKeyShare) UnmarshalBinary(p []byte) (err error)
- func (share GaloisKeyShare) WriteTo(w io.Writer) (n int64, err error)
- type KeySwitchingProtocol
- func (p KeySwitchingProtocol[T]) Aggregate(share1, share2, share3 *KeySwitchingShare) (err error)
- func (p KeySwitchingProtocol[T]) Allocate(level int) *KeySwitchingShare
- func (p KeySwitchingProtocol[T]) Finalize(in *rlwe.Ciphertext, share *KeySwitchingShare, out *rlwe.Ciphertext) (err error)
- func (p KeySwitchingProtocol[T]) FinalizeNew(in *rlwe.Ciphertext, share *KeySwitchingShare) (out *rlwe.Ciphertext, err error)
- func (p KeySwitchingProtocol[T]) Gen(skIn *rlwe.SecretKey, keyOut *T, noise float64, ct *rlwe.Ciphertext, ...) (err error)
- func (p KeySwitchingProtocol[T]) ShallowCopy() *KeySwitchingProtocol[T]
- type KeySwitchingShare
- type PublicKeyProtocol
- func (p PublicKeyProtocol) Aggregate(share1, share2, share3 *PublicKeyShare) (err error)
- func (p PublicKeyProtocol) Allocate() (pkg *PublicKeyShare)
- func (p PublicKeyProtocol) Finalize(share *PublicKeyShare, pubkey *rlwe.PublicKey) (err error)
- func (p PublicKeyProtocol) Gen(sk *rlwe.SecretKey, seed [32]byte, share *PublicKeyShare) (err error)
- func (p PublicKeyProtocol) ShallowCopy() *PublicKeyProtocol
- type PublicKeyShare
- type RefreshShare
- func (share RefreshShare) BinarySize() int
- func (share RefreshShare) Equal(other *RefreshShare) bool
- func (share RefreshShare) MarshalBinary() (p []byte, err error)
- func (share *RefreshShare) ReadFrom(r io.Reader) (n int64, err error)
- func (share *RefreshShare) UnmarshalBinary(p []byte) (err error)
- func (share RefreshShare) WriteTo(w io.Writer) (n int64, err error)
- type RelinearizationKeyProtocol
- func (p RelinearizationKeyProtocol) Aggregate(share1, share2, share3 *RelinearizationKeyShare) (err error)
- func (p RelinearizationKeyProtocol) Allocate(evkParams ...rlwe.EvaluationKeyParameters) *RelinearizationKeyShare
- func (p RelinearizationKeyProtocol) Finalize(share *RelinearizationKeyShare, evk *rlwe.RelinearizationKey) (err error)
- func (p RelinearizationKeyProtocol) Gen(sk *rlwe.SecretKey, pk *rlwe.PublicKey, share *RelinearizationKeyShare) (err error)
- func (p *RelinearizationKeyProtocol) ShallowCopy() *RelinearizationKeyProtocol
- type RelinearizationKeyShare
- type ShamirPolynomial
- type ShamirPublicPoint
- type ShamirSecretShare
- type TestParametersLiteral
- type Thresholdizer
- func (thr Thresholdizer) Aggregate(share1, share2, share3 *ShamirSecretShare) (err error)
- func (thr Thresholdizer) Allocate() *ShamirSecretShare
- func (thr Thresholdizer) Finalize(recipient ShamirPublicPoint, secretPoly *ShamirPolynomial, ...) (err error)
- func (thr Thresholdizer) Gen(threshold int, secret *rlwe.SecretKey) (*ShamirPolynomial, error)
- type VectorShare
- func (share VectorShare) Aggregate(params rlwe.ParameterProvider, share1, share2 *VectorShare) (err error)
- func (share VectorShare) BinarySize() (size int)
- func (share VectorShare) Equal(other *VectorShare) bool
- func (share VectorShare) MarshalBinary() (p []byte, err error)
- func (share *VectorShare) ReadFrom(r io.Reader) (n int64, err error)
- func (share *VectorShare) UnmarshalBinary(p []byte) (err error)
- func (share VectorShare) WriteTo(w io.Writer) (n int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NoiseCircularCiphertext ¶
func NoiseCircularCiphertext(params rlwe.Parameters, hasP bool, d, Log2Basis, nbParties int) (std float64)
func NoiseEvaluationKey ¶
func NoiseEvaluationKey(params rlwe.Parameters, nbParties int) (std float64)
NoiseEvaluationKey returns the standard deviation of the noise of each individual elements in a collective EvaluationKey.
func NoiseGadgetCiphertext ¶
func NoiseGadgetCiphertext(params rlwe.Parameters, nbParties int) (std float64)
NoiseGadgetCiphertext returns the standard deviation of the noise of each individual elements in a gadget ciphertext encrypted with the collective key.
func NoiseGaloisKey ¶
func NoiseGaloisKey(params rlwe.Parameters, nbParties int) (std float64)
NoiseGaloisKey returns the standard deviation of the noise of each individual elements in a collective GaloisKey.
func NoiseKeySwitch ¶
func NoiseRelinearizationKey ¶
func NoiseRelinearizationKey(params rlwe.Parameters, nbParties int) (std float64)
NoiseRelinearizationKey returns the standard deviation of the noise of each individual elements in the collective RelinearizationKey.
Types ¶
type AdditiveShare ¶
type AdditiveShare struct {
}
AdditiveShare is a type for storing additively shared values in Z_Q[X] (RNS domain).
func NewAdditiveShare ¶
func NewAdditiveShare(N int) *AdditiveShare
NewAdditiveShare instantiates a new additive share struct for the ring defined by the given parameters at maximum level.
type AdditiveShareBigint ¶
type AdditiveShareBigint struct {
}
AdditiveShareBigint is a type for storing additively shared values in Z (positional domain).
func NewAdditiveShareBigint ¶
func NewAdditiveShareBigint(n int) *AdditiveShareBigint
NewAdditiveShareBigint instantiates a new additive share struct composed of n big.Int elements.
type CircularCiphertextProtocol ¶
type CircularCiphertextProtocol struct {
GadgetCiphertextProtocol
// contains filtered or unexported fields
}
CircularCiphertextProtocol is a non-interactive public aggregatable transcripts (PAT) protocol by which a set of parties, each holding a secret sk_{i} and a message m_{i}, can collectively generate in a single round the encryption RLWE_{sk}(m*sk) where sk = sum sk_{i} and m = sum m_{i}. An RLWE is an rlwe.Ciphertext.
func NewCircularCiphertextProtocol ¶
func NewCircularCiphertextProtocol(params rlwe.ParameterProvider) *CircularCiphertextProtocol
NewCircularCiphertextProtocol creates an mhe.CircularCiphertextProtocol instance.
func (CircularCiphertextProtocol) Aggregate ¶
func (p CircularCiphertextProtocol) Aggregate(share1, share2, share3 *CircularCiphertextShare) (err error)
Aggregate aggregates the public aggregatable transcripts: share3 = share1 + share2.
func (CircularCiphertextProtocol) Allocate ¶
func (p CircularCiphertextProtocol) Allocate() *CircularCiphertextShare
Allocate allocates a party's share in the mhe.CircularCiphertextProtocol.
func (CircularCiphertextProtocol) Finalize ¶
func (p CircularCiphertextProtocol) Finalize(share *CircularCiphertextShare, ctU *rlwe.GadgetCiphertext, ctMS *rlwe.Ciphertext) (err error)
Finalize takes the public aggregated transcripts (share and ctu) and populates ctMS with RLWE_{s}(ms).
func (CircularCiphertextProtocol) Gen ¶
func (p CircularCiphertextProtocol) Gen(sk, u *rlwe.SecretKey, pt *rlwe.Plaintext, seed [32]byte, share *CircularCiphertextShare) (err error)
Gen populates the mhe.CircularCiphertextShare with the public aggregatable transcript (PAT).
func (CircularCiphertextProtocol) GenEphemeralSecret ¶
func (p CircularCiphertextProtocol) GenEphemeralSecret(sk *rlwe.SecretKey, seed [32]byte, DDGRLWE rlwe.DigitDecomposition) (u *rlwe.SecretKey, share *GadgetCiphertextShare, err error)
GenEphemeralSecret generates the ephemeral secret and its associated public share. This ephemeral secret can be reused across multiple calls of the main protocol.
func (CircularCiphertextProtocol) ShallowCopy ¶
func (p CircularCiphertextProtocol) ShallowCopy() *CircularCiphertextProtocol
ShallowCopy creates a shallow copy of the receiver in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned object can be used concurrently.
type CircularCiphertextShare ¶
type CircularCiphertextShare struct {
}
CircularCiphertextShare is represent a Party's share in the mhe.CircularCiphertextProtocol.
func (CircularCiphertextShare) BinarySize ¶
func (share CircularCiphertextShare) BinarySize() int
BinarySize returns the serialized size of the object in bytes.
func (CircularCiphertextShare) Equal ¶
func (share CircularCiphertextShare) Equal(other *CircularCiphertextShare) bool
Equal performs a deep equal between the receiver and the operand.
func (CircularCiphertextShare) MarshalBinary ¶
func (share CircularCiphertextShare) MarshalBinary() (p []byte, err error)
MarshalBinary encodes the object into a binary form on a newly allocated slice of bytes.
func (*CircularCiphertextShare) ReadFrom ¶
func (share *CircularCiphertextShare) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads on the object from an io.Writer. It implements the io.ReaderFrom interface.
Unless r implements the buffer.Reader interface (see see lattigo/utils/buffer/reader.go), it will be wrapped into a bufio.Reader. Since this requires allocation, it is preferable to pass a buffer.Reader directly:
- When reading multiple values from a io.Reader, it is preferable to first first wrap io.Reader in a pre-allocated bufio.Reader.
- When reading from a var b []byte, it is preferable to pass a buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
func (*CircularCiphertextShare) UnmarshalBinary ¶
func (share *CircularCiphertextShare) UnmarshalBinary(p []byte) (err error)
UnmarshalBinary decodes a slice of bytes generated by MarshalBinary or WriteTo on the object.
func (CircularCiphertextShare) WriteTo ¶
func (share CircularCiphertextShare) WriteTo(w io.Writer) (n int64, err error)
WriteTo writes the object on an io.Writer. It implements the io.WriterTo interface, and will write exactly object.BinarySize() bytes on w.
Unless w implements the buffer.Writer interface (see lattigo/utils/buffer/writer.go), it will be wrapped into a bufio.Writer. Since this requires allocations, it is preferable to pass a buffer.Writer directly:
- When writing multiple times to a io.Writer, it is preferable to first wrap the io.Writer in a pre-allocated bufio.Writer.
- When writing to a pre-allocated var b []byte, it is preferable to pass buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
type CircularGadgetCiphertextProtocol ¶
type CircularGadgetCiphertextProtocol struct {
CircularCiphertextProtocol
// contains filtered or unexported fields
}
CircularGadgetCiphertextProtocol is a non-interactive public aggregatable transcripts (PAT) protocol by which a set of parties, each holding a secret sk_{i} and a message m_{i}, can collectively generate in a single round the encryption GRLWE_{sk}(m*sk) where sk = sum sk_{i} and m = sum m_{i}. An GRLWE is an rlwe.GadgetCiphertext.
func NewCircularGadgetCiphertextProtocol ¶
func NewCircularGadgetCiphertextProtocol(params rlwe.ParameterProvider, LogP int) *CircularGadgetCiphertextProtocol
NewCircularGadgetCiphertextProtocol creates an mhe.CircularGadgetCiphertextProtocol instance.
func (CircularGadgetCiphertextProtocol) Aggregate ¶
func (p CircularGadgetCiphertextProtocol) Aggregate(share1, share2, share3 *CircularGadgetCiphertextShare) (err error)
Aggregate aggregates the public aggregatable transcripts: share3 = share1 + share2.
func (CircularGadgetCiphertextProtocol) Allocate ¶
func (p CircularGadgetCiphertextProtocol) Allocate(dd rlwe.DigitDecomposition) *CircularGadgetCiphertextShare
Allocate allocates a party's share in the mhe.CircularCiphertextProtocol.
func (CircularGadgetCiphertextProtocol) Finalize ¶
func (p CircularGadgetCiphertextProtocol) Finalize(share *CircularGadgetCiphertextShare, ctu *rlwe.GadgetCiphertext, ctMS *rlwe.GadgetCiphertext) (err error)
Finalize takes the public aggregated transcripts (share and ctu) and populates ctMS with GRLWE_{s}(ms).
func (CircularGadgetCiphertextProtocol) FinalizeNew ¶
func (p CircularGadgetCiphertextProtocol) FinalizeNew(share *CircularGadgetCiphertextShare, ctu *rlwe.GadgetCiphertext) (ctMS *rlwe.GadgetCiphertext, err error)
FinalizeNew takes the public aggregated transcripts (share and ctu) returns ctMS with GRLWE_{s}(ms).
func (CircularGadgetCiphertextProtocol) Gen ¶
func (p CircularGadgetCiphertextProtocol) Gen(sk, u *rlwe.SecretKey, pt *rlwe.Plaintext, seed [32]byte, share *CircularGadgetCiphertextShare) (err error)
Gen populates the mhe.CircularGadgetCiphertextShare with the public aggregatable transcript (PAT).
func (CircularGadgetCiphertextProtocol) GenEphemeralSecret ¶
func (p CircularGadgetCiphertextProtocol) GenEphemeralSecret(sk *rlwe.SecretKey, seed [32]byte, DDGRLWE rlwe.DigitDecomposition) (u *rlwe.SecretKey, share *GadgetCiphertextShare, err error)
GenEphemeralSecret generates the ephemeral secret and its associated public share. This ephemeral secret can be reused across multiple calls of the main protocol.
func (CircularGadgetCiphertextProtocol) ShallowCopy ¶
func (p CircularGadgetCiphertextProtocol) ShallowCopy() *CircularGadgetCiphertextProtocol
ShallowCopy creates a shallow copy of the receiver in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned object can be used concurrently.
type CircularGadgetCiphertextShare ¶
type CircularGadgetCiphertextShare struct {
}
CircularGadgetCiphertextShare is represent a Party's share in the mhe.CircularGadgetCiphertextProtocol.
func (CircularGadgetCiphertextShare) BinarySize ¶
func (share CircularGadgetCiphertextShare) BinarySize() int
BinarySize returns the serialized size of the object in bytes.
func (CircularGadgetCiphertextShare) Equal ¶
func (share CircularGadgetCiphertextShare) Equal(other *CircularGadgetCiphertextShare) bool
Equal performs a deep equal between the receiver and the operand.
func (CircularGadgetCiphertextShare) MarshalBinary ¶
func (share CircularGadgetCiphertextShare) MarshalBinary() (p []byte, err error)
MarshalBinary encodes the object into a binary form on a newly allocated slice of bytes.
func (*CircularGadgetCiphertextShare) ReadFrom ¶
func (share *CircularGadgetCiphertextShare) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads on the object from an io.Writer. It implements the io.ReaderFrom interface.
Unless r implements the buffer.Reader interface (see see lattigo/utils/buffer/reader.go), it will be wrapped into a bufio.Reader. Since this requires allocation, it is preferable to pass a buffer.Reader directly:
- When reading multiple values from a io.Reader, it is preferable to first first wrap io.Reader in a pre-allocated bufio.Reader.
- When reading from a var b []byte, it is preferable to pass a buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
func (*CircularGadgetCiphertextShare) UnmarshalBinary ¶
func (share *CircularGadgetCiphertextShare) UnmarshalBinary(p []byte) (err error)
UnmarshalBinary decodes a slice of bytes generated by MarshalBinary or WriteTo on the object.
func (CircularGadgetCiphertextShare) WriteTo ¶
func (share CircularGadgetCiphertextShare) WriteTo(w io.Writer) (n int64, err error)
WriteTo writes the object on an io.Writer. It implements the io.WriterTo interface, and will write exactly object.BinarySize() bytes on w.
Unless w implements the buffer.Writer interface (see lattigo/utils/buffer/writer.go), it will be wrapped into a bufio.Writer. Since this requires allocations, it is preferable to pass a buffer.Writer directly:
- When writing multiple times to a io.Writer, it is preferable to first wrap the io.Writer in a pre-allocated bufio.Writer.
- When writing to a pre-allocated var b []byte, it is preferable to pass buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
type Combiner ¶
type Combiner struct {
// contains filtered or unexported fields
}
Combiner is a type for generating t-out-of-t additive shares from local t-out-of-N shares. It implements the `Combine` operation as presented in "An Efficient Threshold Access-Structure for RLWE-Based Multiparty Homomorphic Encryption" (2022) by Mouchet, C., Bertrand, E., and Hubaux, J. P. (https://eprint.iacr.org/2022/780).
func NewCombiner ¶
func NewCombiner(params rlwe.Parameters, own ShamirPublicPoint, others []ShamirPublicPoint, threshold int) *Combiner
NewCombiner creates a new Combiner struct from the parameters and the set of ShamirPublicPoints. Note that the other parameter may contain the instantiator's own ShamirPublicPoint.
func (Combiner) Finalize ¶
func (cmb Combiner) Finalize(activesPoints []ShamirPublicPoint, ownPoint ShamirPublicPoint, ownShare *ShamirSecretShare, skOut *rlwe.SecretKey) (err error)
Finalize generates a t-out-of-t additive share of the secret from a local aggregated share ownSecret and the set of active identities, identified by their ShamirPublicPoint. It stores the resulting additive share in skOut.
type EvaluationKeyProtocol ¶
type EvaluationKeyProtocol struct {
GadgetCiphertextProtocol
}
EvaluationKeyProtocol is the structure storing the parameters for the collective EvaluationKey generation.
func NewEvaluationKeyProtocol ¶
func NewEvaluationKeyProtocol(params rlwe.ParameterProvider) (p *EvaluationKeyProtocol)
NewEvaluationKeyProtocol instantiates a new mhe.EvaluationKeyProtocol.
func (EvaluationKeyProtocol) Aggregate ¶
func (p EvaluationKeyProtocol) Aggregate(share1, share2, share3 *EvaluationKeyShare) (err error)
Aggregate sets share3 to share1 + share2.
func (EvaluationKeyProtocol) Allocate ¶
func (p EvaluationKeyProtocol) Allocate(evkParams ...rlwe.EvaluationKeyParameters) *EvaluationKeyShare
Allocate allocates a party's share in the mhe.EvaluationKeyProtocol.
func (EvaluationKeyProtocol) Finalize ¶
func (p EvaluationKeyProtocol) Finalize(share *EvaluationKeyShare, evk *rlwe.EvaluationKey) (err error)
Finalize finalizes the protocol and populates the input computed collective rlwe.EvaluationKey.
func (EvaluationKeyProtocol) FinalizeNew ¶
func (p EvaluationKeyProtocol) FinalizeNew(share *EvaluationKeyShare) (evk *rlwe.EvaluationKey)
FinalizeNew finalizes the protocol and returns the computed collective rlwe.EvaluationKey.
func (EvaluationKeyProtocol) Gen ¶
func (p EvaluationKeyProtocol) Gen(skIn, skOut *rlwe.SecretKey, seed [32]byte, share *EvaluationKeyShare) (err error)
Gen generates a party's share in the mhe.EvaluationKeyProtocol.
func (EvaluationKeyProtocol) ShallowCopy ¶
func (p EvaluationKeyProtocol) ShallowCopy() *EvaluationKeyProtocol
ShallowCopy creates a shallow copy of the receiver in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned object can be used concurrently.
type EvaluationKeyShare ¶
type EvaluationKeyShare struct {
}
func (*EvaluationKeyShare) Aggregate ¶
func (share *EvaluationKeyShare) Aggregate(params rlwe.ParameterProvider, a, b *EvaluationKeyShare) (err error)
Aggregate sets the receiver to a + b.
func (EvaluationKeyShare) AsEvaluationKey ¶
func (share EvaluationKeyShare) AsEvaluationKey(params rlwe.ParameterProvider) (evk *rlwe.EvaluationKey)
AsEvaluationKey wraps the receiver into an rlwe.EvaluationKey.
func (EvaluationKeyShare) Equal ¶
func (share EvaluationKeyShare) Equal(other *EvaluationKeyShare) bool
Equal performs a deep equal between the receiver and the operand.
func (EvaluationKeyShare) Get ¶
func (share EvaluationKeyShare) Get(params rlwe.ParameterProvider, evk *rlwe.EvaluationKey) (err error)
Get copies the data of the receiver on a pre-allocated rlwe.EvaluationKey.
func (EvaluationKeyShare) GetNew ¶
func (share EvaluationKeyShare) GetNew(params rlwe.ParameterProvider) (evk *rlwe.EvaluationKey)
GetNew copies the data of the receiver on a new rlwe.EvaluationKey.
type GadgetCiphertextProtocol ¶
type GadgetCiphertextProtocol struct {
*rlwe.KeyGenerator
}
GadgetCiphertextProtocol is the structure storing the parameters for the collective EvaluationKey generation.
func NewGadgetCiphertextProtocol ¶
func NewGadgetCiphertextProtocol(params rlwe.ParameterProvider) (p *GadgetCiphertextProtocol)
NewGadgetCiphertextProtocol instantiates a new mhe.GadgetCiphertextProtocol.
func (GadgetCiphertextProtocol) Aggregate ¶
func (p GadgetCiphertextProtocol) Aggregate(share1, share2, share3 *GadgetCiphertextShare) (err error)
Aggregate sets share3 to share1 + share2.
func (GadgetCiphertextProtocol) Allocate ¶
func (p GadgetCiphertextProtocol) Allocate(LevelQ, LevelP int, DD rlwe.DigitDecomposition) *GadgetCiphertextShare
Allocate allocates a party's share in the mhe.GadgetCiphertextProtocol.
func (GadgetCiphertextProtocol) Finalize ¶
func (p GadgetCiphertextProtocol) Finalize(share *GadgetCiphertextShare, ct *rlwe.GadgetCiphertext) (err error)
Finalize finalizes the protocol and populates the input computed collective rlwe.GadgetCiphertext.
func (GadgetCiphertextProtocol) Gen ¶
func (p GadgetCiphertextProtocol) Gen(sk *rlwe.SecretKey, pt *rlwe.Plaintext, seed [32]byte, share *GadgetCiphertextShare) (err error)
Gen generates a party's share in the mhe.GadgetCiphertextProtocol.
func (GadgetCiphertextProtocol) ShallowCopy ¶
func (p GadgetCiphertextProtocol) ShallowCopy() *GadgetCiphertextProtocol
ShallowCopy creates a shallow copy of the receiver in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned object can be used concurrently.
type GadgetCiphertextShare ¶
type GadgetCiphertextShare struct {
}
func (*GadgetCiphertextShare) Aggregate ¶
func (share *GadgetCiphertextShare) Aggregate(params rlwe.ParameterProvider, a, b *GadgetCiphertextShare) (err error)
Aggregate sets the receiver to a + b.
func (GadgetCiphertextShare) AsGadgetCiphertext ¶
func (share GadgetCiphertextShare) AsGadgetCiphertext(params rlwe.ParameterProvider) (gct *rlwe.GadgetCiphertext)
AsGadgetCiphertext wraps the receiver into an rlwe.GadgetCiphertext.
func (GadgetCiphertextShare) BinarySize ¶
func (share GadgetCiphertextShare) BinarySize() (dataLen int)
BinarySize returns the serialized size of the object in bytes.
func (GadgetCiphertextShare) Equal ¶
func (share GadgetCiphertextShare) Equal(other *GadgetCiphertextShare) bool
Equal performs a deep equal between the receiver and the operand.
func (GadgetCiphertextShare) Get ¶
func (share GadgetCiphertextShare) Get(params rlwe.ParameterProvider, gct *rlwe.GadgetCiphertext) (err error)
Get copies the data of the receiver on a pre-allocated rlwe.GadgetCiphertext.
func (GadgetCiphertextShare) GetNew ¶
func (share GadgetCiphertextShare) GetNew(params rlwe.ParameterProvider) (gct *rlwe.GadgetCiphertext)
GetNew copies the data of the receiver on a new rlwe.GadgetCiphertext.
func (GadgetCiphertextShare) MarshalBinary ¶
func (share GadgetCiphertextShare) MarshalBinary() (data []byte, err error)
MarshalBinary encodes the object into a binary form on a newly allocated slice of bytes.
func (*GadgetCiphertextShare) ReadFrom ¶
func (share *GadgetCiphertextShare) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads on the object from an io.Writer. It implements the io.ReaderFrom interface.
Unless r implements the buffer.Reader interface (see see lattigo/utils/buffer/reader.go), it will be wrapped into a bufio.Reader. Since this requires allocation, it is preferable to pass a buffer.Reader directly:
- When reading multiple values from a io.Reader, it is preferable to first first wrap io.Reader in a pre-allocated bufio.Reader.
- When reading from a var b []byte, it is preferable to pass a buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
func (*GadgetCiphertextShare) UnmarshalBinary ¶
func (share *GadgetCiphertextShare) UnmarshalBinary(p []byte) (err error)
UnmarshalBinary decodes a slice of bytes generated by MarshalBinary or WriteTo on the object.
func (GadgetCiphertextShare) WriteTo ¶
func (share GadgetCiphertextShare) WriteTo(w io.Writer) (n int64, err error)
WriteTo writes the object on an io.Writer. It implements the io.WriterTo interface, and will write exactly object.BinarySize() bytes on w.
Unless w implements the buffer.Writer interface (see lattigo/utils/buffer/writer.go), it will be wrapped into a bufio.Writer. Since this requires allocations, it is preferable to pass a buffer.Writer directly:
- When writing multiple times to a io.Writer, it is preferable to first wrap the io.Writer in a pre-allocated bufio.Writer.
- When writing to a pre-allocated var b []byte, it is preferable to pass buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
type GaloisKeyProtocol ¶
type GaloisKeyProtocol struct {
EvaluationKeyProtocol
}
GaloisKeyProtocol is the structure storing the parameters for the collective GaloisKeys generation.
func NewGaloisKeyProtocol ¶
func NewGaloisKeyProtocol(params rlwe.ParameterProvider) (p *GaloisKeyProtocol)
NewGaloisKeyProtocol creates a GaloisKeyProtocol instance.
func (GaloisKeyProtocol) Aggregate ¶
func (p GaloisKeyProtocol) Aggregate(share1, share2, share3 *GaloisKeyShare) (err error)
Aggregate computes share3 = share1 + share2.
func (GaloisKeyProtocol) Allocate ¶
func (p GaloisKeyProtocol) Allocate(evkParams ...rlwe.EvaluationKeyParameters) (pShare *GaloisKeyShare)
Allocate allocates a party's share in the GaloisKey Generation.
func (GaloisKeyProtocol) Finalize ¶
func (p GaloisKeyProtocol) Finalize(share *GaloisKeyShare, gk *rlwe.GaloisKey) (err error)
Finalize finalizes the GaloisKey Generation and populates the input rlwe.GaloisKey.
func (GaloisKeyProtocol) FinalizeNew ¶
func (p GaloisKeyProtocol) FinalizeNew(share *GaloisKeyShare) (gk *rlwe.GaloisKey)
FinalizeNew finalizes the GaloisKey Generation and returns a new rlwe.GaloisKey.
func (GaloisKeyProtocol) Gen ¶
func (p GaloisKeyProtocol) Gen(sk *rlwe.SecretKey, galEl uint64, seed [32]byte, share *GaloisKeyShare) (err error)
Gen generates a party's share in the GaloisKey Generation.
func (GaloisKeyProtocol) ShallowCopy ¶
func (p GaloisKeyProtocol) ShallowCopy() *GaloisKeyProtocol
ShallowCopy creates a shallow copy of GaloisKeyProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned GaloisKeyProtocol can be used concurrently.
type GaloisKeyShare ¶
type GaloisKeyShare struct {
}
GaloisKeyShare is represent a Party's share in the GaloisKey Generation protocol.
func (GaloisKeyShare) BinarySize ¶
func (share GaloisKeyShare) BinarySize() int
BinarySize returns the serialized size of the object in bytes.
func (GaloisKeyShare) Equal ¶
func (share GaloisKeyShare) Equal(other *GaloisKeyShare) bool
Equal performs a deep equal between the receiver and the operand.
func (GaloisKeyShare) MarshalBinary ¶
func (share GaloisKeyShare) MarshalBinary() (p []byte, err error)
MarshalBinary encodes the object into a binary form on a newly allocated slice of bytes.
func (*GaloisKeyShare) ReadFrom ¶
func (share *GaloisKeyShare) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads on the object from an io.Writer. It implements the io.ReaderFrom interface.
Unless r implements the buffer.Reader interface (see see lattigo/utils/buffer/reader.go), it will be wrapped into a bufio.Reader. Since this requires allocation, it is preferable to pass a buffer.Reader directly:
- When reading multiple values from a io.Reader, it is preferable to first first wrap io.Reader in a pre-allocated bufio.Reader.
- When reading from a var b []byte, it is preferable to pass a buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
func (*GaloisKeyShare) UnmarshalBinary ¶
func (share *GaloisKeyShare) UnmarshalBinary(p []byte) (err error)
UnmarshalBinary decodes a slice of bytes generated by MarshalBinary or WriteTo on the object.
func (GaloisKeyShare) WriteTo ¶
func (share GaloisKeyShare) WriteTo(w io.Writer) (n int64, err error)
WriteTo writes the object on an io.Writer. It implements the io.WriterTo interface, and will write exactly object.BinarySize() bytes on w.
Unless w implements the buffer.Writer interface (see lattigo/utils/buffer/writer.go), it will be wrapped into a bufio.Writer. Since this requires allocations, it is preferable to pass a buffer.Writer directly:
- When writing multiple times to a io.Writer, it is preferable to first wrap the io.Writer in a pre-allocated bufio.Writer.
- When writing to a pre-allocated var b []byte, it is preferable to pass buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
type KeySwitchingProtocol ¶
type KeySwitchingProtocol[T rlwe.SecretKey | rlwe.PublicKey] struct { *rlwe.Encryptor Sk *rlwe.SecretKey }
KeySwitchingProtocol is the structure storing the parameters and and precomputations for the collective key-switching protocol.
func NewKeySwitchingProtocol ¶
func NewKeySwitchingProtocol[T rlwe.SecretKey | rlwe.PublicKey](params rlwe.ParameterProvider) *KeySwitchingProtocol[T]
NewKeySwitchingProtocol creates a new KeySwitchingProtocol that will be used to perform a collective key-switching on a ciphertext encrypted under a collective public-key, whose secret-shares are distributed among j parties, re-encrypting the ciphertext under another public-key, whose secret-shares are also known to the parties.
func (KeySwitchingProtocol[T]) Aggregate ¶
func (p KeySwitchingProtocol[T]) Aggregate(share1, share2, share3 *KeySwitchingShare) (err error)
Aggregate aggregates the public aggregatable transcripts: share3 = share1 + share2.
func (KeySwitchingProtocol[T]) Allocate ¶
func (p KeySwitchingProtocol[T]) Allocate(level int) *KeySwitchingShare
Allocate allocates the share of the KeySwitchingProtocol.
func (KeySwitchingProtocol[T]) Finalize ¶
func (p KeySwitchingProtocol[T]) Finalize(in *rlwe.Ciphertext, share *KeySwitchingShare, out *rlwe.Ciphertext) (err error)
Finalize takes the public aggregated transcripts and peforms an oblivious re-encryption of in and returns the result in out.
func (KeySwitchingProtocol[T]) FinalizeNew ¶
func (p KeySwitchingProtocol[T]) FinalizeNew(in *rlwe.Ciphertext, share *KeySwitchingShare) (out *rlwe.Ciphertext, err error)
FinalizeNew takes the public aggregated transcripts and peforms an oblivious re-encryption of in and returns the result in out.
func (KeySwitchingProtocol[T]) Gen ¶
func (p KeySwitchingProtocol[T]) Gen(skIn *rlwe.SecretKey, keyOut *T, noise float64, ct *rlwe.Ciphertext, share *KeySwitchingShare) (err error)
Gen computes a party's public aggregatable transcrit (share) in the KeySwitchcol. ct is the rlwe.Ciphertext to keyswitch. Note that ct.Q[0] is not used by the function and can be nil/zero.
func (KeySwitchingProtocol[T]) ShallowCopy ¶
func (p KeySwitchingProtocol[T]) ShallowCopy() *KeySwitchingProtocol[T]
ShallowCopy creates a shallow copy of KeySwitchingProtocol in which all the read-only data-structures are shared with the receiver and the temporary bufers are reallocated. The receiver and the returned KeySwitchingProtocol can be used concurrently.
type KeySwitchingShare ¶
type KeySwitchingShare struct {
}
KeySwitchingShare is a type for the KeySwitch protocol shares.
func NewKeySwitchingShare ¶
func NewKeySwitchingShare(p rlwe.ParameterProvider, size, level int) *KeySwitchingShare
func (KeySwitchingShare) Equal ¶
func (share KeySwitchingShare) Equal(other *KeySwitchingShare) bool
Equal performs a deep equal between the receiver and the operand.
type PublicKeyProtocol ¶
PublicKeyProtocol is the structure storing the parameters and and precomputations for the collective encryption key generation protocol.
func NewPublicKeyProtocol ¶
func NewPublicKeyProtocol(params rlwe.ParameterProvider) *PublicKeyProtocol
NewPublicKeyProtocol creates a new PublicKeyProtocol instance
func (PublicKeyProtocol) Aggregate ¶
func (p PublicKeyProtocol) Aggregate(share1, share2, share3 *PublicKeyShare) (err error)
Aggregate evalutes share3 = share1 + share2
func (PublicKeyProtocol) Allocate ¶
func (p PublicKeyProtocol) Allocate() (pkg *PublicKeyShare)
Allocate allocates the share of the PublicKeyGen protocol.
func (PublicKeyProtocol) Finalize ¶
func (p PublicKeyProtocol) Finalize(share *PublicKeyShare, pubkey *rlwe.PublicKey) (err error)
Finalize return the current aggregation of the received shares as a bfv.PublicKey.
func (PublicKeyProtocol) Gen ¶
func (p PublicKeyProtocol) Gen(sk *rlwe.SecretKey, seed [32]byte, share *PublicKeyShare) (err error)
Gen generates the party's public key share from its secret key as:
a[seeded]*s_i + e_i
for the receiver protocol. Has no effect is the share was already generated.
func (PublicKeyProtocol) ShallowCopy ¶
func (p PublicKeyProtocol) ShallowCopy() *PublicKeyProtocol
ShallowCopy creates a shallow copy of the receiver in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned struct can be used concurrently.
type PublicKeyShare ¶
type PublicKeyShare struct {
}
type RefreshShare ¶
type RefreshShare struct {
}
RefreshShare is a struct storing the decryption and recryption shares.
func (RefreshShare) BinarySize ¶
func (share RefreshShare) BinarySize() int
BinarySize returns the serialized size of the object in bytes.
func (RefreshShare) Equal ¶
func (share RefreshShare) Equal(other *RefreshShare) bool
func (RefreshShare) MarshalBinary ¶
func (share RefreshShare) MarshalBinary() (p []byte, err error)
MarshalBinary encodes the object into a binary form on a newly allocated slice of bytes.
func (*RefreshShare) ReadFrom ¶
func (share *RefreshShare) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads on the object from an io.Writer. It implements the io.ReaderFrom interface.
Unless r implements the buffer.Reader interface (see see lattigo/utils/buffer/reader.go), it will be wrapped into a bufio.Reader. Since this requires allocation, it is preferable to pass a buffer.Reader directly:
- When reading multiple values from a io.Reader, it is preferable to first first wrap io.Reader in a pre-allocated bufio.Reader.
- When reading from a var b []byte, it is preferable to pass a buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
func (*RefreshShare) UnmarshalBinary ¶
func (share *RefreshShare) UnmarshalBinary(p []byte) (err error)
UnmarshalBinary decodes a slice of bytes generated by MarshalBinary or WriteTo on the object.
func (RefreshShare) WriteTo ¶
func (share RefreshShare) WriteTo(w io.Writer) (n int64, err error)
WriteTo writes the object on an io.Writer. It implements the io.WriterTo interface, and will write exactly object.BinarySize() bytes on w.
Unless w implements the buffer.Writer interface (see lattigo/utils/buffer/writer.go), it will be wrapped into a bufio.Writer. Since this requires allocations, it is preferable to pass a buffer.Writer directly:
- When writing multiple times to a io.Writer, it is preferable to first wrap the io.Writer in a pre-allocated bufio.Writer.
- When writing to a pre-allocated var b []byte, it is preferable to pass buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
type RelinearizationKeyProtocol ¶
RelinearizationKeyProtocol is the structure storing the parameters and precomputations for the collective relinearization key generation protocol. The protocol is based on https://eprint.iacr.org/2021/1085.
func NewRelinearizationKeyProtocol ¶
func NewRelinearizationKeyProtocol(params rlwe.ParameterProvider) *RelinearizationKeyProtocol
NewRelinearizationKeyProtocol creates a new mhe.RelinearizationKeyProtocol struct.
func (RelinearizationKeyProtocol) Aggregate ¶
func (p RelinearizationKeyProtocol) Aggregate(share1, share2, share3 *RelinearizationKeyShare) (err error)
Aggregate sets share3 to share1 + share2.
func (RelinearizationKeyProtocol) Allocate ¶
func (p RelinearizationKeyProtocol) Allocate(evkParams ...rlwe.EvaluationKeyParameters) *RelinearizationKeyShare
Allocate allocates the share of the mhe.RelinearizationKeyProtocol.
func (RelinearizationKeyProtocol) Finalize ¶
func (p RelinearizationKeyProtocol) Finalize(share *RelinearizationKeyShare, evk *rlwe.RelinearizationKey) (err error)
Finalize finalizes the protocol and populates the input computed collective RelinearizationKey.
func (RelinearizationKeyProtocol) Gen ¶
func (p RelinearizationKeyProtocol) Gen(sk *rlwe.SecretKey, pk *rlwe.PublicKey, share *RelinearizationKeyShare) (err error)
Gen generates a party's share in the RelinearizationKey Generation Protocol.
func (*RelinearizationKeyProtocol) ShallowCopy ¶
func (p *RelinearizationKeyProtocol) ShallowCopy() *RelinearizationKeyProtocol
ShallowCopy creates a shallow copy of the receiver in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned object can be used concurrently.
type RelinearizationKeyShare ¶
type RelinearizationKeyShare struct {
}
RelinearizationKeyShare is a share in the mhe.RelinearizationKeyProtocol.
type ShamirPolynomial ¶
ShamirPolynomial represents a polynomial with ringqp.Poly coefficients. It is used by the Thresholdizer type to produce t-out-of-N-threshold shares of an ringqp.Poly.
See mhe.Thresholdizer.
type ShamirPublicPoint ¶
type ShamirPublicPoint uint64
ShamirPublicPoint is a type for Shamir public point associated with a party identity within the t-out-of-N-threshold scheme.
See Thresholdizer and Combiner types.
type ShamirSecretShare ¶
type ShamirSecretShare struct {
}
ShamirSecretShare represents a t-out-of-N-threshold secret-share.
See mhe.Thresholdizer and mhe.Combiner.
func (ShamirSecretShare) Equal ¶
func (s ShamirSecretShare) Equal(other *ShamirSecretShare) bool
Equal performs a deep equal.
type TestParametersLiteral ¶
type TestParametersLiteral struct {
rlwe.DigitDecomposition
rlwe.ParametersLiteral
}
type Thresholdizer ¶
type Thresholdizer struct {
// contains filtered or unexported fields
}
Thresholdizer is a type for generating secret-shares of ringqp.Poly types such that the resulting sharing has a t-out-of-N-threshold access-structure. It implements the `Thresholdize` operation as presented in "An Efficient Threshold Access-Structure for RLWE-Based Multiparty Homomorphic Encryption" (2022) by Mouchet, C., Bertrand, E., and Hubaux, J. P. (https://eprint.iacr.org/2022/780).
See the `mhe` package README.md.
func NewThresholdizer ¶
func NewThresholdizer(params rlwe.ParameterProvider) *Thresholdizer
NewThresholdizer creates a new Thresholdizer instance from parameters.
func (Thresholdizer) Aggregate ¶
func (thr Thresholdizer) Aggregate(share1, share2, share3 *ShamirSecretShare) (err error)
Aggregate aggregates two ShamirSecretShare and stores the result in outShare.
func (Thresholdizer) Allocate ¶
func (thr Thresholdizer) Allocate() *ShamirSecretShare
Allocate allocates a ShamirSecretShare struct.
func (Thresholdizer) Finalize ¶
func (thr Thresholdizer) Finalize(recipient ShamirPublicPoint, secretPoly *ShamirPolynomial, shareOut *ShamirSecretShare) (err error)
Finalize generates a secret share for the given recipient, identified by its ShamirPublicPoint. The result is stored in ShareOut and should be sent to this party.
func (Thresholdizer) Gen ¶
func (thr Thresholdizer) Gen(threshold int, secret *rlwe.SecretKey) (*ShamirPolynomial, error)
Gen generates a new secret ShamirPolynomial to be used in the Thresholdizer.GenShamirSecretShare method. It does so by sampling a random polynomial of degree threshold - 1 and with its constant term equal to secret.
type VectorShare ¶
type VectorShare struct {
}
VectorShare is a struct storing the PublicKeyGen protocol's share.
func NewVectorShare ¶
func NewVectorShare(params rlwe.ParameterProvider, LevelQ, LevelP, size int) *VectorShare
func (VectorShare) Aggregate ¶
func (share VectorShare) Aggregate(params rlwe.ParameterProvider, share1, share2 *VectorShare) (err error)
func (VectorShare) BinarySize ¶
func (share VectorShare) BinarySize() (size int)
BinarySize returns the serialized size of the object in bytes.
func (VectorShare) Equal ¶
func (share VectorShare) Equal(other *VectorShare) bool
Equal performs a deep equal between the receiver and the operand.
func (VectorShare) MarshalBinary ¶
func (share VectorShare) MarshalBinary() (p []byte, err error)
MarshalBinary encodes the object into a binary form on a newly allocated slice of bytes.
func (*VectorShare) ReadFrom ¶
func (share *VectorShare) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom reads on the object from an io.Writer. It implements the io.ReaderFrom interface.
Unless r implements the buffer.Reader interface (see see lattigo/utils/buffer/reader.go), it will be wrapped into a bufio.Reader. Since this requires allocation, it is preferable to pass a buffer.Reader directly:
- When reading multiple values from a io.Reader, it is preferable to first first wrap io.Reader in a pre-allocated bufio.Reader.
- When reading from a var b []byte, it is preferable to pass a buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
func (*VectorShare) UnmarshalBinary ¶
func (share *VectorShare) UnmarshalBinary(p []byte) (err error)
UnmarshalBinary decodes a slice of bytes generated by MarshalBinary or WriteTo on the object.
func (VectorShare) WriteTo ¶
func (share VectorShare) WriteTo(w io.Writer) (n int64, err error)
WriteTo writes the object on an io.Writer. It implements the io.WriterTo interface, and will write exactly object.BinarySize() bytes on w.
Unless w implements the buffer.Writer interface (see lattigo/utils/buffer/writer.go), it will be wrapped into a bufio.Writer. Since this requires allocations, it is preferable to pass a buffer.Writer directly:
- When writing multiple times to a io.Writer, it is preferable to first wrap the io.Writer in a pre-allocated bufio.Writer.
- When writing to a pre-allocated var b []byte, it is preferable to pass buffer.NewBuffer(b) as w (see lattigo/utils/buffer/buffer.go).
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mhefloat implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/hefloat` See `mhe/README.md` for additional information on multiparty schemes.
|
Package mhefloat implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/hefloat` See `mhe/README.md` for additional information on multiparty schemes. |
|
Package mheint implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/heint` See `mhe/README.md` for additional information on multiparty schemes.
|
Package mheint implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/heint` See `mhe/README.md` for additional information on multiparty schemes. |