Documentation
¶
Overview ¶
Package kms
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms ¶
Package kms
Index ¶
- func NewCommit(data []byte) (Commitments, Nonce, error)
- type BitSlice
- type CiphertextPair
- type Commitments
- type DLogProof
- type KenGenParams
- type KeyGenCommWitness
- type KeyGenParty1FirstMsg
- type KeyGenParty1FourthMsg
- type KeyGenParty1SecondMsg
- type KeyGenParty1ThirdMsg
- type KeyGenParty2FirstMsg
- type KeyGenParty2SThirdMsg
- type KeyGenParty2SecondMsg
- type MasterKey1
- type MasterKey2
- type NICorrectKeyProof
- type Nonce
- type PDLChallenge
- type Party1Generator
- func (g *Party1Generator) KeyGenMaster() (*MasterKey1, error)
- func (g *Party1Generator) KeyGenPhase1() ([]byte, error)
- func (g *Party1Generator) KeyGenPhase2(msg []byte) ([]byte, error)
- func (g *Party1Generator) KeyGenPhase3(msg []byte) ([]byte, error)
- func (g *Party1Generator) KeyGenPhase4(msg []byte) ([]byte, error)
- type Party1PDLDecommit
- type Party1PDLFirstMsg
- type Party1Paillier
- type Party1SignCtx
- type Party2Generator
- func (g *Party2Generator) KeyGenMaster() (*MasterKey2, error)
- func (g *Party2Generator) KeyGenPhase1(msg []byte) ([]byte, error)
- func (g *Party2Generator) KeyGenPhase2(msg []byte) ([]byte, error)
- func (g *Party2Generator) KeyGenPhase3(msg []byte) ([]byte, error)
- func (g *Party2Generator) KeyGenPhase4(msg []byte) error
- type Party2PDLDecommit
- type Party2PDLFirstMsg
- type Party2Paillier
- func (p *Party2Paillier) PDLChallenge(pubShare *ecdsa.PublicKey) (*Party2PDLFirstMsg, *PDLChallenge, error)
- func (p *Party2Paillier) PDLDecommit(challenge *PDLChallenge) *Party2PDLDecommit
- func (p *Party2Paillier) VerifyPDL(alphaComm *Commitments, pdlDecomm *Party1PDLDecommit, challenge *PDLChallenge) error
- type Party2SignCtx
- type ProofPair
- type RangeProof
- type RangeProofProver
- type RangeProofVerifier
- type SecretPair
- type SignParty1FirstMsg
- type SignParty1SecondMsg
- type SignParty2FirstMsg
- type SignParty2SecondMsg
- type SignRCommWitness
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CiphertextPair ¶
func NewCiphertextPairs ¶
func NewCiphertextPairs(size int) []CiphertextPair
type Commitments ¶
type Commitments [32]byte
Avoid Rogue Key Attacks
func (*Commitments) MarshalText ¶
func (c *Commitments) MarshalText() ([]byte, error)
func (*Commitments) UnmarshalText ¶
func (c *Commitments) UnmarshalText(input []byte) error
type DLogProof ¶
type KenGenParams ¶
type KeyGenCommWitness ¶
type KeyGenParty1FirstMsg ¶
type KeyGenParty1FirstMsg struct { PkCommit Commitments `json:"pkcommit"` ZkPokCommit Commitments `json:"zkpokcommit"` }
type KeyGenParty1FourthMsg ¶
type KeyGenParty1FourthMsg struct {
PdlDecommit *Party1PDLDecommit `json:"pdldecommit"`
}
type KeyGenParty1SecondMsg ¶
type KeyGenParty1SecondMsg struct { Witness *KeyGenCommWitness `json:"witness"` Ckey *big.Int `json:"ckey"` CKProof *NICorrectKeyProof `json:"ckproof"` RPCtxtPairs []CiphertextPair `json:"rpctx"` }
type KeyGenParty1ThirdMsg ¶
type KeyGenParty1ThirdMsg struct { Party1PdlMsg1 *Party1PDLFirstMsg `json:"pdlmsg1"` RPProofPairs []ProofPair `json:"rpproof"` }
type KeyGenParty2FirstMsg ¶
type KeyGenParty2FirstMsg struct { Proof *DLogProof `json:"dlogproof"` RPChalComm Commitments `json:"rpchalcomm"` }
type KeyGenParty2SThirdMsg ¶
type KeyGenParty2SThirdMsg struct {
PdlDecomm *Party2PDLDecommit `json:"pdldecomm"`
}
type KeyGenParty2SecondMsg ¶
type KeyGenParty2SecondMsg struct { Pdl1stMsg *Party2PDLFirstMsg `json:"pdlmsg1"` RPChallenge BitSlice `json:"rpchallenge"` RPChalNonce Nonce `json:"rpchalnonce"` }
type MasterKey1 ¶
type MasterKey1 struct { Sk1 *ecdsa.PrivateKey // Pk *ecdsa.PublicKey Pk2 *ecdsa.PublicKey PSk *paillier.PrivateKey // the privateKey for paillier }
MasterKey1 the privatekey for the server
func (*MasterKey1) MarshalJSON ¶
func (k *MasterKey1) MarshalJSON() ([]byte, error)
func (*MasterKey1) UnmarshalJSON ¶
func (k *MasterKey1) UnmarshalJSON(input []byte) error
type MasterKey2 ¶
type MasterKey2 struct { Sk2 *ecdsa.PrivateKey // ecdsa privateKey Pk *ecdsa.PublicKey Pk1 *ecdsa.PublicKey Ckey *big.Int PPK *paillier.PublicKey // the publicKey for paillier }
MasterKey2 the privateKey for client
func (*MasterKey2) MarshalJSON ¶
func (k *MasterKey2) MarshalJSON() ([]byte, error)
func (*MasterKey2) UnmarshalJSON ¶
func (k *MasterKey2) UnmarshalJSON(input []byte) error
type NICorrectKeyProof ¶
type NICorrectKeyProof struct { PPk *paillier.PublicKey `json:"paillier"` Sigma []*big.Int `json:"sigma"` }
func NewCorrectKeyProof ¶
func NewCorrectKeyProof(p1Paillier *Party1Paillier) (*NICorrectKeyProof, error)
func (*NICorrectKeyProof) Verify ¶
func (p *NICorrectKeyProof) Verify() error
type PDLChallenge ¶
type Party1Generator ¶
type Party1Generator struct { Sk1Puk ecdsa.PublicKey X2 *ecdsa.PublicKey // Range Proof RPProver *RangeProofProver // contains filtered or unexported fields }
func (*Party1Generator) KeyGenMaster ¶
func (g *Party1Generator) KeyGenMaster() (*MasterKey1, error)
func (*Party1Generator) KeyGenPhase1 ¶
func (g *Party1Generator) KeyGenPhase1() ([]byte, error)
func (*Party1Generator) KeyGenPhase2 ¶
func (g *Party1Generator) KeyGenPhase2(msg []byte) ([]byte, error)
func (*Party1Generator) KeyGenPhase3 ¶
func (g *Party1Generator) KeyGenPhase3(msg []byte) ([]byte, error)
func (*Party1Generator) KeyGenPhase4 ¶
func (g *Party1Generator) KeyGenPhase4(msg []byte) ([]byte, error)
type Party1PDLDecommit ¶
type Party1PDLFirstMsg ¶
type Party1PDLFirstMsg struct {
AlphaComm Commitments `json:"alphacomm"`
}
type Party1Paillier ¶
type Party1Paillier struct {
// contains filtered or unexported fields
}
func (*Party1Paillier) PDLFirstStage ¶
func (p *Party1Paillier) PDLFirstStage(pdlMsg1 *Party2PDLFirstMsg) (*Party1PDLFirstMsg, *Party1PDLDecommit, *ecdsa.PrivateKey, error)
func (*Party1Paillier) PDLSecondStage ¶
func (p *Party1Paillier) PDLSecondStage(p2Decomm *Party2PDLDecommit, p2PdlMsg1 *Party2PDLFirstMsg, x1 *ecdsa.PrivateKey, alpha *ecdsa.PrivateKey) error
type Party1SignCtx ¶
type Party1SignCtx struct {
// contains filtered or unexported fields
}
func NewParty1SignCtx ¶
func NewParty1SignCtx(sk *MasterKey1, hash []byte) *Party1SignCtx
func (*Party1SignCtx) SignPhase1 ¶
func (ctx *Party1SignCtx) SignPhase1(msg []byte) ([]byte, error)
func (*Party1SignCtx) SignPhase2 ¶
func (ctx *Party1SignCtx) SignPhase2(msg []byte) ([]byte, error)
type Party2Generator ¶
type Party2Generator struct { Sk2Puk ecdsa.PublicKey // Party2 公钥 X1 *ecdsa.PublicKey // contains filtered or unexported fields }
func (*Party2Generator) KeyGenMaster ¶
func (g *Party2Generator) KeyGenMaster() (*MasterKey2, error)
func (*Party2Generator) KeyGenPhase1 ¶
func (g *Party2Generator) KeyGenPhase1(msg []byte) ([]byte, error)
func (*Party2Generator) KeyGenPhase2 ¶
func (g *Party2Generator) KeyGenPhase2(msg []byte) ([]byte, error)
func (*Party2Generator) KeyGenPhase3 ¶
func (g *Party2Generator) KeyGenPhase3(msg []byte) ([]byte, error)
func (*Party2Generator) KeyGenPhase4 ¶
func (g *Party2Generator) KeyGenPhase4(msg []byte) error
type Party2PDLDecommit ¶
type Party2PDLFirstMsg ¶
type Party2PDLFirstMsg struct { CPrime []byte `json:"cprime"` ABComm Commitments `json:"abcomm"` }
type Party2Paillier ¶
type Party2Paillier struct {
// contains filtered or unexported fields
}
func (*Party2Paillier) PDLChallenge ¶
func (p *Party2Paillier) PDLChallenge(pubShare *ecdsa.PublicKey) (*Party2PDLFirstMsg, *PDLChallenge, error)
func (*Party2Paillier) PDLDecommit ¶
func (p *Party2Paillier) PDLDecommit(challenge *PDLChallenge) *Party2PDLDecommit
func (*Party2Paillier) VerifyPDL ¶
func (p *Party2Paillier) VerifyPDL(alphaComm *Commitments, pdlDecomm *Party1PDLDecommit, challenge *PDLChallenge) error
type Party2SignCtx ¶
type Party2SignCtx struct {
// contains filtered or unexported fields
}
func NewParty2SignCtx ¶
func NewParty2SignCtx(sk *MasterKey2, hash []byte) *Party2SignCtx
func (*Party2SignCtx) GetSignature ¶
func (ctx *Party2SignCtx) GetSignature() (*big.Int, *big.Int)
func (*Party2SignCtx) SignPhase1 ¶
func (ctx *Party2SignCtx) SignPhase1() ([]byte, error)
func (*Party2SignCtx) SignPhase2 ¶
func (ctx *Party2SignCtx) SignPhase2(msg []byte) ([]byte, error)
func (*Party2SignCtx) SignPhase3 ¶
func (ctx *Party2SignCtx) SignPhase3(msg []byte) error
type ProofPair ¶
type ProofPair struct { J byte `json:"j"` W1 *big.Int `json:"w1,omitempty"` R1 *big.Int `json:"k1,omitempty"` W2 *big.Int `json:"w2,omitempty"` R2 *big.Int `json:"r2,omitempty"` }
func NewProofPairs ¶
type RangeProof ¶
type RangeProof struct { CtxtPairs []CiphertextPair ProofPairs []ProofPair }
type RangeProofProver ¶
type RangeProofProver struct { X *big.Int R *big.Int PSK *paillier.PrivateKey Q *big.Int Q3 *big.Int ChallengeComm Commitments Accuracy int SecPairs []SecretPair CtxtPairs []CiphertextPair }
func NewRangeProofProver ¶
func NewRangeProofProver(x *big.Int, r *big.Int, q *big.Int, q3 *big.Int, psk *paillier.PrivateKey, comm Commitments, accuracy int) (*RangeProofProver, error)
type RangeProofVerifier ¶
type RangeProofVerifier struct { C *big.Int PPK *paillier.PublicKey Q3 *big.Int Challenge BitSlice Comm Commitments Nonce Nonce Accuracy int CtxtPairs []CiphertextPair }
func NewRangeProofVerifier ¶
func NewRangeProofVerifier(q3 *big.Int, accuracy int) (*RangeProofVerifier, error)
func (*RangeProofVerifier) ReceiveCtxt ¶
func (p *RangeProofVerifier) ReceiveCtxt(c *big.Int, ppk *paillier.PublicKey, ctxtPairs []CiphertextPair)
func (*RangeProofVerifier) Verify ¶
func (p *RangeProofVerifier) Verify(proofPairs []ProofPair) error
type SecretPair ¶
func NewSecretPairs ¶
func NewSecretPairs(size int) []SecretPair
type SignParty1FirstMsg ¶
type SignParty1FirstMsg struct {
R1Proof *DLogProof `json:"r1proof"`
}
type SignParty1SecondMsg ¶
type SignParty2FirstMsg ¶
type SignParty2FirstMsg struct { R2Commit Commitments `json:"r2commit"` R2PokCommit Commitments `json:"r2pokcomm"` Hash []byte `json:"hash"` }
type SignParty2SecondMsg ¶
type SignParty2SecondMsg struct { Witness *SignRCommWitness `json:"witness"` S1 *big.Int `json:"s1"` }
type SignRCommWitness ¶
Click to show internal directories.
Click to hide internal directories.