server

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: 8 Imported by: 0

Documentation

Overview

Package server

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

Package server

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

Package server

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

Package server

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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFinalKeyMismatch = errors.New("final OT key doesn't match")
	ErrKeyNotGenerated  = errors.New("private key has not been generated")
)

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 Party2

type Party2 struct {

	// Keygen phase 2
	X1PoKComm common.Comm

	X2         *eckey.PublicKey           // 公钥
	X2PoK      *common.DLogPoK            // 2P-ECDSA-KEYGEN-2 对应的sign和公钥
	RPVerifier *common.RangeProofVerifier // 随机证明的校验者

	// Keygen phase 4
	X1      *eckey.PublicKey
	PPK     *paillier.PublicKey
	CKey    *big.Int
	CPrime  *big.Int
	A       *big.Int
	B       *big.Int
	ABNonce common.Nonce

	// Keygen phase 6
	AlphaComm common.Comm

	// Keygen phase 8
	Q *eckey.PublicKey
	// contains filtered or unexported fields
}

func NewParty2

func NewParty2(cfg *common.Config) *Party2

func (*Party2) KeyGenPhase2

func (p *Party2) KeyGenPhase2(sid uint64, m1 *KeyGenMsg1) (*KeyGenMsg2, error)

生成x2

func (*Party2) KeyGenPhase4

func (p *Party2) KeyGenPhase4(sid uint64, m3 *KeyGenMsg3) (*KeyGenMsg4, error)

生成PPK,CKey

func (*Party2) KeyGenPhase6

func (p *Party2) KeyGenPhase6(sid uint64, m5 *KeyGenMsg5) (*KeyGenMsg6, error)

func (*Party2) KeyGenPhase8

func (p *Party2) KeyGenPhase8(
	sid uint64,
	m7 *KeyGenMsg7) error

func (*Party2) PrivateKey

func (p *Party2) PrivateKey() (*Party2PrivateKey, error)

type Party2PrivateKey

type Party2PrivateKey struct {
	Cfg       *common.Config
	PPK       *paillier.PublicKey
	CKey      *big.Int
	X2SK      *eckey.SecretKey
	PublicKey *btcec.PublicKey
}

func (*Party2PrivateKey) NewSignCtx

func (sk *Party2PrivateKey) NewSignCtx(msg []byte) *Party2SignCtx

type Party2SignCtx

type Party2SignCtx struct {

	// Sign phase 2
	R1PoKComm common.Comm

	R2    *eckey.PublicKey
	R2PoK *common.DLogPoK

	// Sign phase 4
	R1 *eckey.PublicKey
	// contains filtered or unexported fields
}

func (*Party2SignCtx) SignMsgPhase2

func (p *Party2SignCtx) SignMsgPhase2(sid uint64, m1 *SignMsg1) (*SignMsg2, error)

func (*Party2SignCtx) SignMsgPhase4

func (p *Party2SignCtx) SignMsgPhase4(sid uint64, m3 *SignMsg3) (*SignMsg4, error)

func (*Party2SignCtx) Zero

func (c *Party2SignCtx) 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