client

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package client

@author: xwc1125 @date: 2019/9/25

Package client

@author: xwc1125 @date: 2019/9/25

Package client

@author: xwc1125 @date: 2019/9/25

Package client

@author: xwc1125 @date: 2019/9/25

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOTMac    = errors.New("invalid one-time MAC")
	ErrKeyNotGenerated = errors.New("private key has not been generated")
)
View Source
var ErrInvalidSignature = errors.New("invalid presignature created")

Functions

This section is empty.

Types

type KeyGenMsg1

type KeyGenMsg1 struct {
	X1PoKComm common.Comm
}

type KeyGenMsg2

type KeyGenMsg2 struct {
	X2PoK      *common.DLogPoK
	RPChalComm common.Comm
}

type KeyGenMsg3

type KeyGenMsg3 struct {
	X1PoK       *common.DLogPoK
	X1PoKNonce  common.Nonce
	PProof      *common.PaillierNthRootProof
	Ckey        []byte
	RPCtxtPairs []common.CiphertextPair
}

type KeyGenMsg4

type KeyGenMsg4 struct {
	RPChallenge common.BitSlice
	RPChalNonce common.Nonce
	CPrime      *big.Int
	ABComm      common.Comm
}

type KeyGenMsg5

type KeyGenMsg5 struct {
	RPProofPairs []common.ProofPair
	AlphaComm    common.Comm
}

type KeyGenMsg6

type KeyGenMsg6 struct {
	A       *big.Int
	B       *big.Int
	ABNonce common.Nonce
}

type KeyGenMsg7

type KeyGenMsg7 struct {
	AlphaPK    *eckey.CompressedPublicKey
	AlphaNonce common.Nonce
}

type Party1

type Party1 struct {
	Cfg *common.Config

	// Keygen phase 1
	Sx1     *eckey.SecretKey // 私钥
	X1      *eckey.PublicKey // 公钥
	X1PoK   *common.DLogPoK  // DlogPoK 2P-ECDSA-KEYGEN-1的sign和公钥内容
	X1Nonce common.Nonce     // nonce值

	// Keygen phase 3
	X2        *eckey.PublicKey // 公钥
	PSK       *paillier.PrivateKey
	CKey      *big.Int
	CKeyNonce *big.Int
	RPProver  *common.RangeProofProver

	// Keygen phase 5
	ABComm     common.Comm
	Alpha      *big.Int
	AlphaPK    *eckey.CompressedPublicKey
	AlphaNonce common.Nonce

	// Keygen phase 7
	Q *eckey.PublicKey
}

func NewParty1

func NewParty1(cfg *common.Config) *Party1

func (*Party1) KeyGenPhase1

func (p *Party1) KeyGenPhase1(sid uint64) (*KeyGenMsg1, error)

生成Sx1

func (*Party1) KeyGenPhase3

func (p *Party1) KeyGenPhase3(sid uint64, m2 *KeyGenMsg2) (*KeyGenMsg3, error)

生成PSK

func (*Party1) KeyGenPhase5

func (p *Party1) KeyGenPhase5(sid uint64, m4 *KeyGenMsg4) (*KeyGenMsg5, error)

func (*Party1) KeyGenPhase7

func (p *Party1) KeyGenPhase7(sid uint64, m6 *KeyGenMsg6) (*KeyGenMsg7, error)

func (*Party1) PrivateKey

func (p *Party1) PrivateKey() (*Party1PrivateKey, error)

type Party1PrivateKey

type Party1PrivateKey struct {
	Cfg       *common.Config
	PSK       *paillier.PrivateKey
	X1SK      *eckey.SecretKey
	PublicKey *btcec.PublicKey
}

func (*Party1PrivateKey) NewSignCtx

func (sk *Party1PrivateKey) NewSignCtx(msg []byte) *Party1SignCtx

type Party1SignCtx

type Party1SignCtx struct {
	R1         *eckey.PublicKey
	R1PoK      *common.DLogPoK
	R1PoKNonce common.Nonce

	// Sign phase 3
	R2 *eckey.PublicKey
	// contains filtered or unexported fields
}

func (*Party1SignCtx) SignMsgPhase1

func (p *Party1SignCtx) SignMsgPhase1(sid uint64) (*SignMsg1, error)

func (*Party1SignCtx) SignMsgPhase3

func (p *Party1SignCtx) SignMsgPhase3(sid uint64, m2 *SignMsg2) (*SignMsg3, error)

func (*Party1SignCtx) SignMsgPhase5

func (p *Party1SignCtx) SignMsgPhase5(sid uint64, m4 *SignMsg4) (*btcec.Signature, error)

func (*Party1SignCtx) Zero

func (c *Party1SignCtx) Zero()

type SignMsg1

type SignMsg1 struct {
	R1PoKComm common.Comm
}

type SignMsg2

type SignMsg2 struct {
	R2PoK *common.DLogPoK
}

type SignMsg3

type SignMsg3 struct {
	R1PoK      *common.DLogPoK
	R1PoKNonce common.Nonce
}

type SignMsg4

type SignMsg4 struct {
	C3 *big.Int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL