Documentation
¶
Overview ¶
Package dbfv implements a distributed (or threshold) version of the BFV scheme that enables secure multiparty computation solutions with secret-shared secret keys.
Index ¶
- type CKGProtocol
- type CKSProtocol
- type E2SProtocol
- type MaskedTransformFunc
- type MaskedTransformProtocol
- func (rfp *MaskedTransformProtocol) Aggregate(share1, share2, shareOut *MaskedTransformShare)
- func (rfp *MaskedTransformProtocol) AllocateShare() *MaskedTransformShare
- func (rfp *MaskedTransformProtocol) GenShares(sk *rlwe.SecretKey, ciphertext *bfv.Ciphertext, crs drlwe.CKSCRP, ...)
- func (rfp *MaskedTransformProtocol) SampleCRP(level int, crs utils.PRNG) drlwe.CKSCRP
- func (rfp *MaskedTransformProtocol) Transform(ciphertext *bfv.Ciphertext, transform MaskedTransformFunc, crs drlwe.CKSCRP, ...)
- type MaskedTransformShare
- type PCKSProtocol
- type RKGProtocol
- type RTGProtocol
- type RefreshProtocol
- func (rfp *RefreshProtocol) Aggregate(share1, share2, shareOut *RefreshShare)
- func (rfp *RefreshProtocol) AllocateShare() *RefreshShare
- func (rfp *RefreshProtocol) Finalize(ciphertext *bfv.Ciphertext, crp drlwe.CKSCRP, share *RefreshShare, ...)
- func (rfp *RefreshProtocol) GenShares(sk *rlwe.SecretKey, ciphertext *bfv.Ciphertext, crp drlwe.CKSCRP, ...)
- type RefreshShare
- type S2EProtocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CKGProtocol ¶
type CKGProtocol struct {
drlwe.CKGProtocol
}
CKGProtocol is the structure storing the parameters and state for a party in the collective key generation protocol.
func NewCKGProtocol ¶
func NewCKGProtocol(params bfv.Parameters) *CKGProtocol
NewCKGProtocol creates a new CKGProtocol instance
type CKSProtocol ¶
type CKSProtocol struct { drlwe.CKSProtocol // contains filtered or unexported fields }
CKSProtocol is a structure storing the parameters for the collective key-switching protocol.
func NewCKSProtocol ¶
func NewCKSProtocol(params bfv.Parameters, sigmaSmudging float64) *CKSProtocol
NewCKSProtocol creates a new CKSProtocol that will be used to operate 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 (*CKSProtocol) AllocateShareBFV ¶ added in v2.2.0
func (pcks *CKSProtocol) AllocateShareBFV() *drlwe.CKSShare
AllocateShareBFV allocates the shares of one party in the CKS protocol for BFV.
type E2SProtocol ¶ added in v2.2.0
type E2SProtocol struct { 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 ¶ added in v2.2.0
func NewE2SProtocol(params bfv.Parameters, sigmaSmudging float64) *E2SProtocol
NewE2SProtocol creates a new E2SProtocol struct from the passed BFV parameters.
func (*E2SProtocol) GenShare ¶ added in v2.2.0
func (e2s *E2SProtocol) GenShare(sk *rlwe.SecretKey, ct *bfv.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.
func (*E2SProtocol) GetShare ¶ added in v2.2.0
func (e2s *E2SProtocol) GetShare(secretShare *rlwe.AdditiveShare, aggregatePublicShare *drlwe.CKSShare, ct *bfv.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.
type MaskedTransformFunc ¶ added in v2.2.0
type MaskedTransformFunc func(ptIn, ptOut bfv.PlaintextRingT)
MaskedTransformFunc is type of functions that can be operated on masked BFV plaintexts as a part of the Masked Transform Protocol.
type MaskedTransformProtocol ¶ added in v2.2.0
type MaskedTransformProtocol struct {
// contains filtered or unexported fields
}
MaskedTransformProtocol is a struct storing the parameters for the MaskedTransformProtocol protocol.
func NewMaskedTransformProtocol ¶ added in v2.2.0
func NewMaskedTransformProtocol(params bfv.Parameters, sigmaSmudging float64) (rfp *MaskedTransformProtocol)
NewMaskedTransformProtocol creates a new instance of the PermuteProtocol.
func (*MaskedTransformProtocol) Aggregate ¶ added in v2.2.0
func (rfp *MaskedTransformProtocol) Aggregate(share1, share2, shareOut *MaskedTransformShare)
Aggregate sums share1 and share2 on shareOut.
func (*MaskedTransformProtocol) AllocateShare ¶ added in v2.2.0
func (rfp *MaskedTransformProtocol) AllocateShare() *MaskedTransformShare
AllocateShare allocates the shares of the PermuteProtocol
func (*MaskedTransformProtocol) GenShares ¶ added in v2.2.0
func (rfp *MaskedTransformProtocol) GenShares(sk *rlwe.SecretKey, ciphertext *bfv.Ciphertext, crs drlwe.CKSCRP, transform MaskedTransformFunc, shareOut *MaskedTransformShare)
GenShares generates the shares of the PermuteProtocol
func (*MaskedTransformProtocol) SampleCRP ¶ added in v2.3.0
SampleCRP samples a common random polynomial to be used in the Masked-Transform protocol from the provided common reference string.
func (*MaskedTransformProtocol) Transform ¶ added in v2.2.0
func (rfp *MaskedTransformProtocol) Transform(ciphertext *bfv.Ciphertext, transform MaskedTransformFunc, crs drlwe.CKSCRP, share *MaskedTransformShare, ciphertextOut *bfv.Ciphertext)
Transform applies Decrypt, Recode and Recrypt on the input ciphertext.
type MaskedTransformShare ¶ added in v2.2.0
type MaskedTransformShare struct {
// contains filtered or unexported fields
}
MaskedTransformShare is a struct storing the decryption and recryption shares.
func (*MaskedTransformShare) MarshalBinary ¶ added in v2.2.0
func (share *MaskedTransformShare) MarshalBinary() ([]byte, error)
MarshalBinary encodes a RefreshShare on a slice of bytes.
func (*MaskedTransformShare) UnmarshalBinary ¶ added in v2.2.0
func (share *MaskedTransformShare) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes a marshaled RefreshShare on the target RefreshShare.
type PCKSProtocol ¶
type PCKSProtocol struct { drlwe.PCKSProtocol // contains filtered or unexported fields }
PCKSProtocol is the structure storing the parameters for the collective public key-switching.
func NewPCKSProtocol ¶
func NewPCKSProtocol(params bfv.Parameters, sigmaSmudging float64) *PCKSProtocol
NewPCKSProtocol creates a new PCKSProtocol object and will be used to re-encrypt a ciphertext ctx encrypted under a secret-shared key among j parties under a new collective public-key.
func (*PCKSProtocol) AllocateShareBFV ¶ added in v2.2.0
func (pcks *PCKSProtocol) AllocateShareBFV() *drlwe.PCKSShare
AllocateShareBFV allocates the shares of one party in the PCKS protocol for BFV.
type RKGProtocol ¶
type RKGProtocol struct {
drlwe.RKGProtocol
}
RKGProtocol is the structure storing the parameters and state for a party in the collective relinearization key generation protocol.
func NewRKGProtocol ¶ added in v2.2.0
func NewRKGProtocol(params bfv.Parameters) *RKGProtocol
NewRKGProtocol creates a new RKGProtocol object that will be used to generate a collective evaluation-key among j parties in the given context with the given bit-decomposition.
type RTGProtocol ¶
type RTGProtocol struct {
drlwe.RTGProtocol
}
RTGProtocol is the structure storing the parameters for the collective rotation-keys generation.
func NewRotKGProtocol ¶
func NewRotKGProtocol(params bfv.Parameters) (rtg *RTGProtocol)
NewRotKGProtocol creates a new rotkg object and will be used to generate collective rotation-keys from a shared secret-key among j parties.
type RefreshProtocol ¶
type RefreshProtocol struct {
MaskedTransformProtocol
}
RefreshProtocol is a struct storing the relevant parameters for the Refresh protocol.
func NewRefreshProtocol ¶
func NewRefreshProtocol(params bfv.Parameters, sigmaSmudging float64) (rfp *RefreshProtocol)
NewRefreshProtocol creates a new Refresh protocol instance.
func (*RefreshProtocol) Aggregate ¶
func (rfp *RefreshProtocol) Aggregate(share1, share2, shareOut *RefreshShare)
Aggregate aggregates two parties' shares in the Refresh protocol.
func (*RefreshProtocol) AllocateShare ¶ added in v2.2.0
func (rfp *RefreshProtocol) AllocateShare() *RefreshShare
AllocateShare allocates the shares of the PermuteProtocol
func (*RefreshProtocol) Finalize ¶
func (rfp *RefreshProtocol) Finalize(ciphertext *bfv.Ciphertext, crp drlwe.CKSCRP, share *RefreshShare, ciphertextOut *bfv.Ciphertext)
Finalize applies Decrypt, Recode and Recrypt on the input ciphertext.
func (*RefreshProtocol) GenShares ¶
func (rfp *RefreshProtocol) GenShares(sk *rlwe.SecretKey, ciphertext *bfv.Ciphertext, crp drlwe.CKSCRP, shareOut *RefreshShare)
GenShares generates a share for the Refresh protocol.
type RefreshShare ¶
type RefreshShare struct {
}RefreshShare is a struct storing a party's share in the Refresh protocol.
type S2EProtocol ¶ added in v2.2.0
type S2EProtocol struct { 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 ¶ added in v2.2.0
func NewS2EProtocol(params bfv.Parameters, sigmaSmudging float64) *S2EProtocol
NewS2EProtocol creates a new S2EProtocol struct from the passed BFV parameters.
func (*S2EProtocol) GenShare ¶ added in v2.2.0
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 ¶ added in v2.2.0
func (s2e *S2EProtocol) GetEncryption(c0Agg *drlwe.CKSShare, crp drlwe.CKSCRP, ctOut *bfv.Ciphertext)
GetEncryption computes the final encryption of the secret-shared message when provided with the aggregation `c0Agg` of the parties' share in the protocol and with the common, CRS-sampled polynomial `crp`.