Documentation
¶
Overview ¶
Package cggmp21 implements the CGGMP21 threshold ECDSA protocol Reference: "UC Non-Interactive, Proactive, Threshold ECDSA with Identifiable Aborts" by Canetti, Gennaro, Goldfeder, Makriyannis, and Peled (2021)
Index ¶
- func GeneratePaillierKeyPair(bits int) (*PaillierPrivateKey, *PaillierPublicKey, error)
- func L(x, n *big.Int) *big.Int
- func VerifyKnowledge(proof *ZKProof, ciphertext *big.Int) bool
- func VerifySignature(pubKey *ecdsa.PublicKey, message []byte, sig *Signature) bool
- type Config
- type ECPoint
- type IdentifiableAbort
- type PaillierPrivateKey
- type PaillierPublicKey
- type Party
- func (p *Party) Finalize(sessionID string, round4msgs map[int]*Round4Message) (*Signature, error)
- func (p *Party) InitiateSign(sessionID string, message []byte) (*SigningSession, error)
- func (p *Party) KeyGen(parties []int) error
- func (p *Party) Round1_Commitment(sessionID string) ([]byte, error)
- func (p *Party) Round2_Reveal(sessionID string, commitments map[int][]byte) (*Round2Message, error)
- func (p *Party) Round3_Multiply(sessionID string, reveals map[int]*Round2Message) (*Round3Message, error)
- func (p *Party) Round4_Open(sessionID string, round3msgs map[int]*Round3Message) (*Round4Message, error)
- type Round2Message
- type Round3Message
- type Round4Message
- type Signature
- type SigningSession
- type ZKProof
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePaillierKeyPair ¶
func GeneratePaillierKeyPair(bits int) (*PaillierPrivateKey, *PaillierPublicKey, error)
GeneratePaillierKeyPair generates a new Paillier keypair
func VerifyKnowledge ¶
VerifyKnowledge verifies a ZK proof of plaintext knowledge
Types ¶
type Config ¶
type Config struct {
Threshold int // t: Threshold (t+1 parties needed to sign)
TotalParties int // n: Total number of parties
Curve elliptic.Curve
SessionTimeout int64 // Timeout for protocol rounds
}
Config contains CGGMP21 protocol configuration
type IdentifiableAbort ¶
IdentifiableAbort contains information about a misbehaving party
type PaillierPrivateKey ¶
type PaillierPrivateKey struct {
PublicKey *PaillierPublicKey
Lambda *big.Int // lcm(p-1, q-1)
Mu *big.Int // modular multiplicative inverse
P *big.Int // prime p
Q *big.Int // prime q
}
PaillierPrivateKey represents a Paillier private key
type PaillierPublicKey ¶
type PaillierPublicKey struct {
N *big.Int // n = p*q
NSq *big.Int // n^2
G *big.Int // generator (typically n+1)
}
PaillierPublicKey represents a Paillier public key
func (*PaillierPublicKey) Add ¶
func (pub *PaillierPublicKey) Add(c1, c2 *big.Int) *big.Int
Add performs homomorphic addition of two ciphertexts
type Party ¶
type Party struct {
ID ids.NodeID
Index int
Config *Config
// Key material
Xi *big.Int // Secret key share
PublicKey *ecdsa.PublicKey // Group public key
// Paillier keys for ZK proofs
PaillierSK *PaillierPrivateKey
PaillierPKs map[int]*PaillierPublicKey
// contains filtered or unexported fields
}
Party represents a participant in the CGGMP21 protocol
func (*Party) InitiateSign ¶
func (p *Party) InitiateSign(sessionID string, message []byte) (*SigningSession, error)
InitiateSign starts a new signing session
func (*Party) Round1_Commitment ¶
Round1_Commitment generates and broadcasts commitment
func (*Party) Round2_Reveal ¶
Round2_Reveal reveals gamma values after receiving all commitments
func (*Party) Round3_Multiply ¶
func (p *Party) Round3_Multiply(sessionID string, reveals map[int]*Round2Message) (*Round3Message, error)
Round3_Multiply performs multiplication phase
func (*Party) Round4_Open ¶
func (p *Party) Round4_Open(sessionID string, round3msgs map[int]*Round3Message) (*Round4Message, error)
Round4_Open performs the opening phase
type Round2Message ¶
type Round3Message ¶
type Round4Message ¶
type SigningSession ¶
type SigningSession struct {
SessionID string
Message []byte
MessageHash *big.Int
// Round 1: Commitment
Ki *big.Int // k_i (nonce share)
Gammai *big.Int // gamma_i (random mask)
CommitmentSent bool
Commitments map[int][]byte // Received commitments
// Round 2: Reveal
RevealsSent bool
// Round 3: Multiplication
// Round 4: Opening
Deltas map[int]*big.Int // delta_j values
BigRx *ECPoint // R_x point
// Final signature
R *big.Int
S *big.Int
// Abort handling
AbortingParties []int
}
SigningSession represents an active signing session
type ZKProof ¶
type ZKProof struct {
E *big.Int // Commitment
Z *big.Int // Response
Pub *PaillierPublicKey
}
ZKProof represents a zero-knowledge proof of plaintext knowledge
func ProveKnowledge ¶
func ProveKnowledge(pub *PaillierPublicKey, plaintext, randomness *big.Int) (*ZKProof, error)
ProveKnowledge creates a ZK proof of plaintext knowledge