Documentation ¶
Overview ¶
Package mpbgv implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `schemes/bgv` See `multiparty/README.md` for additional information on multiparty schemes.
Index ¶
- func NewAdditiveShare(params bgv.Parameters) multiparty.AdditiveShare
- type EncToShareProtocol
- func (e2s EncToShareProtocol) AllocateShare(level int) (share multiparty.KeySwitchShare)
- func (e2s EncToShareProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, ...)
- func (e2s EncToShareProtocol) GetShare(secretShare *multiparty.AdditiveShare, ...)
- func (e2s EncToShareProtocol) ShallowCopy() EncToShareProtocol
- type MaskedTransformFunc
- type MaskedTransformProtocol
- func (rfp MaskedTransformProtocol) AggregateShares(share1, share2 multiparty.RefreshShare, shareOut *multiparty.RefreshShare) (err error)
- func (rfp MaskedTransformProtocol) AllocateShare(levelDecrypt, levelRecrypt int) multiparty.RefreshShare
- func (rfp MaskedTransformProtocol) GenShare(skIn, skOut *rlwe.SecretKey, ct *rlwe.Ciphertext, crs multiparty.KeySwitchCRP, ...) (err error)
- func (rfp *MaskedTransformProtocol) SampleCRP(level int, crs sampling.PRNG) multiparty.KeySwitchCRP
- func (rfp MaskedTransformProtocol) ShallowCopy() MaskedTransformProtocol
- func (rfp MaskedTransformProtocol) Transform(ct *rlwe.Ciphertext, transform *MaskedTransformFunc, ...) (err error)
- type RefreshProtocol
- func (rfp RefreshProtocol) AggregateShares(share1, share2 multiparty.RefreshShare, shareOut *multiparty.RefreshShare) (err error)
- func (rfp RefreshProtocol) AllocateShare(inputLevel, outputLevel int) multiparty.RefreshShare
- func (rfp RefreshProtocol) Finalize(ctIn *rlwe.Ciphertext, crp multiparty.KeySwitchCRP, ...) (err error)
- func (rfp RefreshProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, crp multiparty.KeySwitchCRP, ...) (err error)
- func (rfp *RefreshProtocol) ShallowCopy() RefreshProtocol
- type ShareToEncProtocol
- func (s2e ShareToEncProtocol) AllocateShare(level int) (share multiparty.KeySwitchShare)
- func (s2e ShareToEncProtocol) GenShare(sk *rlwe.SecretKey, crp multiparty.KeySwitchCRP, ...) (err error)
- func (s2e ShareToEncProtocol) GetEncryption(c0Agg multiparty.KeySwitchShare, crp multiparty.KeySwitchCRP, ...) (err error)
- func (s2e ShareToEncProtocol) ShallowCopy() ShareToEncProtocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdditiveShare ¶
func NewAdditiveShare(params bgv.Parameters) multiparty.AdditiveShare
Types ¶
type EncToShareProtocol ¶
type EncToShareProtocol struct { // contains filtered or unexported fields }
EncToShareProtocol is the structure storing the parameters and temporary buffers required by the encryption-to-shares protocol.
func NewEncToShareProtocol ¶
func NewEncToShareProtocol(params bgv.Parameters, noiseFlooding ring.DistributionParameters) (EncToShareProtocol, error)
NewEncToShareProtocol creates a new EncToShareProtocol struct from the passed bgv.Parameters.
func (EncToShareProtocol) AllocateShare ¶
func (e2s EncToShareProtocol) AllocateShare(level int) (share multiparty.KeySwitchShare)
AllocateShare allocates a share of the EncToShare protocol
func (EncToShareProtocol) GenShare ¶
func (e2s EncToShareProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, secretShareOut *multiparty.AdditiveShare, publicShareOut *multiparty.KeySwitchShare)
GenShare generates a party's share in the encryption-to-shares protocol. This share consist in the additive secret-share of the party which is written in secretShareOut and in the public masked-decryption share written in publicShareOut. ct1 is degree 1 element of a rlwe.Ciphertext, i.e. rlwe.Ciphertext.Value[1].
func (EncToShareProtocol) GetShare ¶
func (e2s EncToShareProtocol) GetShare(secretShare *multiparty.AdditiveShare, aggregatePublicShare multiparty.KeySwitchShare, ct *rlwe.Ciphertext, secretShareOut *multiparty.AdditiveShare)
GetShare is the final step of the encryption-to-share protocol. It performs the masked decryption of the target ciphertext followed by a the removal of the caller's secretShare as generated in the EncToShareProtocol.GenShare method. If the caller is not secret-key-share holder (i.e., didn't generate a decryption share), secretShare can be set to nil. Therefore, in order to obtain an additive sharing of the message, only one party should call this method, and the other parties should use the secretShareOut output of the GenShare method.
func (EncToShareProtocol) ShallowCopy ¶
func (e2s EncToShareProtocol) ShallowCopy() EncToShareProtocol
ShallowCopy creates a shallow copy of EncToShareProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned EncToShareProtocol can be used concurrently.
type MaskedTransformFunc ¶
MaskedTransformFunc is a struct containing a user-defined in-place function that can be applied to masked integer plaintexts, as a part of the Masked Transform Protocol. The function is called with a vector of integers modulo bgv.Parameters.PlaintextModulus() of size bgv.Parameters.N() as input, and must write its output on the same buffer. Transform can be the identity.
- Decode: if true, then the masked BFV plaintext will be decoded before applying Transform.
- Recode: if true, then the masked BFV plaintext will be recoded after applying Transform.
Decode (true/false) -> Transform -> Recode (true/false).
type MaskedTransformProtocol ¶
type MaskedTransformProtocol struct {
// contains filtered or unexported fields
}
MaskedTransformProtocol is a struct storing the parameters for the MaskedTransformProtocol protocol.
func NewMaskedTransformProtocol ¶
func NewMaskedTransformProtocol(paramsIn, paramsOut bgv.Parameters, noiseFlooding ring.DistributionParameters) (rfp MaskedTransformProtocol, err error)
NewMaskedTransformProtocol creates a new instance of the PermuteProtocol.
func (MaskedTransformProtocol) AggregateShares ¶
func (rfp MaskedTransformProtocol) AggregateShares(share1, share2 multiparty.RefreshShare, shareOut *multiparty.RefreshShare) (err error)
AggregateShares sums share1 and share2 on shareOut.
func (MaskedTransformProtocol) AllocateShare ¶
func (rfp MaskedTransformProtocol) AllocateShare(levelDecrypt, levelRecrypt int) multiparty.RefreshShare
AllocateShare allocates the shares of the PermuteProtocol
func (MaskedTransformProtocol) GenShare ¶
func (rfp MaskedTransformProtocol) GenShare(skIn, skOut *rlwe.SecretKey, ct *rlwe.Ciphertext, crs multiparty.KeySwitchCRP, transform *MaskedTransformFunc, shareOut *multiparty.RefreshShare) (err error)
GenShare generates the shares of the PermuteProtocol. ct1 is the degree 1 element of a rlwe.Ciphertext, i.e. rlwe.Ciphertext.Value[1].
func (*MaskedTransformProtocol) SampleCRP ¶
func (rfp *MaskedTransformProtocol) SampleCRP(level int, crs sampling.PRNG) multiparty.KeySwitchCRP
SampleCRP samples a common random polynomial to be used in the Masked-Transform protocol from the provided common reference string.
func (MaskedTransformProtocol) ShallowCopy ¶
func (rfp MaskedTransformProtocol) ShallowCopy() MaskedTransformProtocol
ShallowCopy creates a shallow copy of MaskedTransformProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned MaskedTransformProtocol can be used concurrently.
func (MaskedTransformProtocol) Transform ¶
func (rfp MaskedTransformProtocol) Transform(ct *rlwe.Ciphertext, transform *MaskedTransformFunc, crs multiparty.KeySwitchCRP, share multiparty.RefreshShare, ciphertextOut *rlwe.Ciphertext) (err error)
Transform applies Decrypt, Recode and Recrypt on the input ciphertext.
type RefreshProtocol ¶
type RefreshProtocol struct {
MaskedTransformProtocol
}
RefreshProtocol is a struct storing the relevant parameters for the Refresh protocol.
func NewRefreshProtocol ¶
func NewRefreshProtocol(params bgv.Parameters, noiseFlooding ring.DistributionParameters) (rfp RefreshProtocol, err error)
NewRefreshProtocol creates a new Refresh protocol instance.
func (RefreshProtocol) AggregateShares ¶
func (rfp RefreshProtocol) AggregateShares(share1, share2 multiparty.RefreshShare, shareOut *multiparty.RefreshShare) (err error)
AggregateShares aggregates two parties' shares in the Refresh protocol.
func (RefreshProtocol) AllocateShare ¶
func (rfp RefreshProtocol) AllocateShare(inputLevel, outputLevel int) multiparty.RefreshShare
AllocateShare allocates the shares of the PermuteProtocol
func (RefreshProtocol) Finalize ¶
func (rfp RefreshProtocol) Finalize(ctIn *rlwe.Ciphertext, crp multiparty.KeySwitchCRP, share multiparty.RefreshShare, opOut *rlwe.Ciphertext) (err error)
Finalize applies Decrypt, Recode and Recrypt on the input ciphertext.
func (RefreshProtocol) GenShare ¶
func (rfp RefreshProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, crp multiparty.KeySwitchCRP, shareOut *multiparty.RefreshShare) (err error)
GenShare generates a share for the Refresh protocol. ct1 is degree 1 element of a rlwe.Ciphertext, i.e. rlwe.Ciphertext.Value[1].
func (*RefreshProtocol) ShallowCopy ¶
func (rfp *RefreshProtocol) ShallowCopy() RefreshProtocol
ShallowCopy creates a shallow copy of RefreshProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned RefreshProtocol can be used concurrently.
type ShareToEncProtocol ¶
type ShareToEncProtocol struct { // contains filtered or unexported fields }
ShareToEncProtocol is the structure storing the parameters and temporary buffers required by the shares-to-encryption protocol.
func NewShareToEncProtocol ¶
func NewShareToEncProtocol(params bgv.Parameters, noiseFlooding ring.DistributionParameters) (ShareToEncProtocol, error)
NewShareToEncProtocol creates a new ShareToEncProtocol struct from the passed integer parameters.
func (ShareToEncProtocol) AllocateShare ¶
func (s2e ShareToEncProtocol) AllocateShare(level int) (share multiparty.KeySwitchShare)
AllocateShare allocates a share of the ShareToEnc protocol
func (ShareToEncProtocol) GenShare ¶
func (s2e ShareToEncProtocol) GenShare(sk *rlwe.SecretKey, crp multiparty.KeySwitchCRP, secretShare multiparty.AdditiveShare, c0ShareOut *multiparty.KeySwitchShare) (err error)
GenShare generates a party's in the shares-to-encryption protocol given the party's secret-key share `sk`, a common polynomial sampled from the CRS `crp` and the party's secret share of the message.
func (ShareToEncProtocol) GetEncryption ¶
func (s2e ShareToEncProtocol) GetEncryption(c0Agg multiparty.KeySwitchShare, crp multiparty.KeySwitchCRP, opOut *rlwe.Ciphertext) (err error)
GetEncryption computes the final encryption of the secret-shared message when provided with the aggregation `c0Agg` of the parties' shares in the protocol and with the common, CRS-sampled polynomial `crp`.
func (ShareToEncProtocol) ShallowCopy ¶
func (s2e ShareToEncProtocol) ShallowCopy() ShareToEncProtocol
ShallowCopy creates a shallow copy of ShareToEncProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned ShareToEncProtocol can be used concurrently.