Documentation ¶
Overview ¶
Package dbgv implements a distributed (or threshold) version of the BGV scheme that enables secure multiparty computation solutions. See `drlwe/README.md` for additional information on multiparty schemes.
Package dbgv implements a distributed (or threshold) version of the BGV scheme that enables secure multiparty computation solutions with secret-shared secret keys.
Index ¶
- func NewCKGProtocol(params bgv.Parameters) *drlwe.CKGProtocol
- func NewCKSProtocol(params bgv.Parameters, sigmaSmudging float64) *drlwe.CKSProtocol
- func NewPCKSProtocol(params bgv.Parameters, sigmaSmudging float64) *drlwe.PCKSProtocol
- func NewRKGProtocol(params bgv.Parameters) *drlwe.RKGProtocol
- func NewRTGProtocol(params bgv.Parameters) *drlwe.RTGProtocol
- type E2SProtocol
- func (e2s *E2SProtocol) AllocateShare(level int) (share *drlwe.CKSShare)
- func (e2s *E2SProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, secretShareOut *rlwe.AdditiveShare, ...)
- func (e2s *E2SProtocol) GetShare(secretShare *rlwe.AdditiveShare, aggregatePublicShare *drlwe.CKSShare, ...)
- func (e2s *E2SProtocol) ShallowCopy() *E2SProtocol
- type MaskedTransformFunc
- type MaskedTransformProtocol
- func (rfp *MaskedTransformProtocol) AggregateShares(share1, share2, shareOut *MaskedTransformShare)
- func (rfp *MaskedTransformProtocol) AllocateShare(levelDecrypt, levelRecrypt int) *MaskedTransformShare
- func (rfp *MaskedTransformProtocol) GenShare(skIn, skOut *rlwe.SecretKey, ct *rlwe.Ciphertext, scale rlwe.Scale, ...)
- func (rfp *MaskedTransformProtocol) SampleCRP(level int, crs utils.PRNG) drlwe.CKSCRP
- func (rfp *MaskedTransformProtocol) ShallowCopy() *MaskedTransformProtocol
- func (rfp *MaskedTransformProtocol) Transform(ct *rlwe.Ciphertext, transform *MaskedTransformFunc, crs drlwe.CKSCRP, ...)
- type MaskedTransformShare
- type RefreshProtocol
- func (rfp *RefreshProtocol) AggregateShares(share1, share2, shareOut *RefreshShare)
- func (rfp *RefreshProtocol) AllocateShare(inputLevel, outputLevel int) *RefreshShare
- func (rfp *RefreshProtocol) Finalize(ctIn *rlwe.Ciphertext, crp drlwe.CKSCRP, share *RefreshShare, ...)
- func (rfp *RefreshProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, scale rlwe.Scale, crp drlwe.CKSCRP, ...)
- func (rfp *RefreshProtocol) ShallowCopy() *RefreshProtocol
- type RefreshShare
- type S2EProtocol
- func (s2e S2EProtocol) AllocateShare(level int) (share *drlwe.CKSShare)
- func (s2e *S2EProtocol) GenShare(sk *rlwe.SecretKey, crp drlwe.CKSCRP, secretShare *rlwe.AdditiveShare, ...)
- func (s2e *S2EProtocol) GetEncryption(c0Agg *drlwe.CKSShare, crp drlwe.CKSCRP, ctOut *rlwe.Ciphertext)
- func (s2e *S2EProtocol) ShallowCopy() *S2EProtocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCKGProtocol ¶
func NewCKGProtocol(params bgv.Parameters) *drlwe.CKGProtocol
NewCKGProtocol creates a new drlwe.CKGProtocol instance from the BGV parameters. The returned protocol instance is generic and can be used in other multiparty schemes.
func NewCKSProtocol ¶
func NewCKSProtocol(params bgv.Parameters, sigmaSmudging float64) *drlwe.CKSProtocol
NewCKSProtocol creates a new drlwe.CKSProtocol instance from the BGV parameters. The returned protocol instance is generic and can be used in other multiparty schemes.
func NewPCKSProtocol ¶
func NewPCKSProtocol(params bgv.Parameters, sigmaSmudging float64) *drlwe.PCKSProtocol
NewPCKSProtocol creates a new drlwe.PCKSProtocol instance from the BGV paramters. The returned protocol instance is generic and can be used in other multiparty schemes.
func NewRKGProtocol ¶
func NewRKGProtocol(params bgv.Parameters) *drlwe.RKGProtocol
NewRKGProtocol creates a new drlwe.RKGProtocol instance from the BGV parameters. The returned protocol instance is generic and can be used in other multiparty schemes.
func NewRTGProtocol ¶
func NewRTGProtocol(params bgv.Parameters) *drlwe.RTGProtocol
NewRTGProtocol creates a new drlwe.RTGProtocol instance from the BGV parameters. The returned protocol instance is generic and can be used in other multiparty schemes.
Types ¶
type E2SProtocol ¶
type E2SProtocol struct { drlwe.CKSProtocol // contains filtered or unexported fields }
E2SProtocol is the structure storing the parameters and temporary buffers required by the encryption-to-shares protocol.
func NewE2SProtocol ¶
func NewE2SProtocol(params bgv.Parameters, sigmaSmudging float64) *E2SProtocol
NewE2SProtocol creates a new E2SProtocol struct from the passed bgv parameters.
func (*E2SProtocol) AllocateShare ¶
func (e2s *E2SProtocol) AllocateShare(level int) (share *drlwe.CKSShare)
AllocateShare allocates a share of the E2S protocol
func (*E2SProtocol) GenShare ¶
func (e2s *E2SProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, secretShareOut *rlwe.AdditiveShare, publicShareOut *drlwe.CKSShare)
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 bgv.Ciphertext, i.e. bgv.Ciphertext.Value[1].
func (*E2SProtocol) GetShare ¶
func (e2s *E2SProtocol) GetShare(secretShare *rlwe.AdditiveShare, aggregatePublicShare *drlwe.CKSShare, ct *rlwe.Ciphertext, secretShareOut *rlwe.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 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 (*E2SProtocol) ShallowCopy ¶
func (e2s *E2SProtocol) ShallowCopy() *E2SProtocol
ShallowCopy creates a shallow copy of E2SProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned E2SProtocol can be used concurrently.
type MaskedTransformFunc ¶
MaskedTransformFunc is a struct containing a user-defined in-place function that can be applied to masked bgv plaintexts, as a part of the Masked Transform Protocol. The function is called with a vector of integers modulo bgv.Parameters.T() 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. i.e. : 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, sigmaSmudging float64) (rfp *MaskedTransformProtocol, err error)
NewMaskedTransformProtocol creates a new instance of the PermuteProtocol.
func (*MaskedTransformProtocol) AggregateShares ¶
func (rfp *MaskedTransformProtocol) AggregateShares(share1, share2, shareOut *MaskedTransformShare)
AggregateShares sums share1 and share2 on shareOut.
func (*MaskedTransformProtocol) AllocateShare ¶
func (rfp *MaskedTransformProtocol) AllocateShare(levelDecrypt, levelRecrypt int) *MaskedTransformShare
AllocateShare allocates the shares of the PermuteProtocol
func (*MaskedTransformProtocol) GenShare ¶
func (rfp *MaskedTransformProtocol) GenShare(skIn, skOut *rlwe.SecretKey, ct *rlwe.Ciphertext, scale rlwe.Scale, crs drlwe.CKSCRP, transform *MaskedTransformFunc, shareOut *MaskedTransformShare)
GenShare generates the shares of the PermuteProtocol. ct1 is the degree 1 element of a bgv.Ciphertext, i.e. bgv.Ciphertext.Value[1].
func (*MaskedTransformProtocol) SampleCRP ¶
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 drlwe.CKSCRP, share *MaskedTransformShare, ciphertextOut *rlwe.Ciphertext)
Transform applies Decrypt, Recode and Recrypt on the input ciphertext.
type MaskedTransformShare ¶
type MaskedTransformShare struct {
// contains filtered or unexported fields
}
MaskedTransformShare is a struct storing the decryption and recryption shares.
func (*MaskedTransformShare) MarshalBinary ¶
func (share *MaskedTransformShare) MarshalBinary() (data []byte, err error)
MarshalBinary encodes a RefreshShare on a slice of bytes.
func (*MaskedTransformShare) UnmarshalBinary ¶
func (share *MaskedTransformShare) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes a marshaled RefreshShare on the target RefreshShare.
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, sigmaSmudging float64) (rfp *RefreshProtocol)
NewRefreshProtocol creates a new Refresh protocol instance.
func (*RefreshProtocol) AggregateShares ¶
func (rfp *RefreshProtocol) AggregateShares(share1, share2, shareOut *RefreshShare)
AggregateShares aggregates two parties' shares in the Refresh protocol.
func (*RefreshProtocol) AllocateShare ¶
func (rfp *RefreshProtocol) AllocateShare(inputLevel, outputLevel int) *RefreshShare
AllocateShare allocates the shares of the PermuteProtocol
func (*RefreshProtocol) Finalize ¶
func (rfp *RefreshProtocol) Finalize(ctIn *rlwe.Ciphertext, crp drlwe.CKSCRP, share *RefreshShare, ctOut *rlwe.Ciphertext)
Finalize applies Decrypt, Recode and Recrypt on the input ciphertext.
func (*RefreshProtocol) GenShare ¶
func (rfp *RefreshProtocol) GenShare(sk *rlwe.SecretKey, ct *rlwe.Ciphertext, scale rlwe.Scale, crp drlwe.CKSCRP, shareOut *RefreshShare)
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 RefreshShare ¶
type RefreshShare struct {
}RefreshShare is a struct storing a party's share in the Refresh protocol.
type S2EProtocol ¶
type S2EProtocol struct { drlwe.CKSProtocol // contains filtered or unexported fields }
S2EProtocol is the structure storing the parameters and temporary buffers required by the shares-to-encryption protocol.
func NewS2EProtocol ¶
func NewS2EProtocol(params bgv.Parameters, sigmaSmudging float64) *S2EProtocol
NewS2EProtocol creates a new S2EProtocol struct from the passed bgv parameters.
func (S2EProtocol) AllocateShare ¶
func (s2e S2EProtocol) AllocateShare(level int) (share *drlwe.CKSShare)
AllocateShare allocates a share of the S2E protocol
func (*S2EProtocol) GenShare ¶
func (s2e *S2EProtocol) GenShare(sk *rlwe.SecretKey, crp drlwe.CKSCRP, secretShare *rlwe.AdditiveShare, c0ShareOut *drlwe.CKSShare)
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 (*S2EProtocol) GetEncryption ¶
func (s2e *S2EProtocol) GetEncryption(c0Agg *drlwe.CKSShare, crp drlwe.CKSCRP, ctOut *rlwe.Ciphertext)
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 (*S2EProtocol) ShallowCopy ¶
func (s2e *S2EProtocol) ShallowCopy() *S2EProtocol
ShallowCopy creates a shallow copy of S2EProtocol in which all the read-only data-structures are shared with the receiver and the temporary buffers are reallocated. The receiver and the returned S2EProtocol can be used concurrently.