Documentation ¶
Index ¶
- Variables
- func Commit(data []byte) (Comm, Nonce, error)
- func NewPrivKey(modulus *big.Int) (*eckey.SecretKey, error)
- type BitSlice
- type CiphertextPair
- type Comm
- type Config
- type DLogPoK
- type KeyGenMsg1
- type KeyGenMsg2
- type KeyGenMsg3
- type KeyGenMsg4
- type KeyGenMsg5
- type KeyGenMsg6
- type KeyGenMsg7
- type Nonce
- type PaillierNthRootProof
- type Party1
- func (p *Party1) GenKey(p2 *Party2, x1, x2 *eckey.SecretKey) (*Party1PrivateKey, error)
- func (p *Party1) KeyGenPhase1(sid uint64) (*KeyGenMsg1, error)
- func (p *Party1) KeyGenPhase3(sid uint64, m2 *KeyGenMsg2) (*KeyGenMsg3, error)
- func (p *Party1) KeyGenPhase5(sid uint64, m4 *KeyGenMsg4) (*KeyGenMsg5, error)
- func (p *Party1) KeyGenPhase7(sid uint64, m6 *KeyGenMsg6) (*KeyGenMsg7, error)
- type Party1PrivateKey
- func (sk *Party1PrivateKey) NewSSSignCtx(msg []byte, T *eckey.CompressedPublicKey) *Party1SSSignCtx
- func (sk *Party1PrivateKey) NewSignCtx(msg []byte) *Party1SignCtx
- func (sk1 *Party1PrivateKey) ScriptlessSign(msg []byte, t *eckey.SecretKey, sk2 *Party2PrivateKey) (*btcec.Signature, *eckey.SecretKey, error)
- func (sk1 *Party1PrivateKey) Sign(msg []byte, sk2 *Party2PrivateKey) (*btcec.Signature, error)
- type Party1SSSignCtx
- func (p *Party1SSSignCtx) Extract(sig *btcec.Signature) (*eckey.SecretKey, error)
- func (p *Party1SSSignCtx) SSSignMsgPhase1(sid uint64) (*SSSignMsg1, error)
- func (p *Party1SSSignCtx) SSSignMsgPhase3(sid uint64, m2 *SSSignMsg2) (*SSSignMsg3, error)
- func (p *Party1SSSignCtx) SSSignMsgPhase5(sid uint64, m4 *SSSignMsg4) (*SSSignMsg5, error)
- func (c *Party1SSSignCtx) Zero()
- type Party1SignCtx
- type Party2
- func (p *Party2) KeyGenPhase2(sid uint64, m1 *KeyGenMsg1) (*KeyGenMsg2, error)
- func (p *Party2) KeyGenPhase4(sid uint64, m3 *KeyGenMsg3) (*KeyGenMsg4, error)
- func (p *Party2) KeyGenPhase6(sid uint64, m5 *KeyGenMsg5) (*KeyGenMsg6, error)
- func (p *Party2) KeyGenPhase8(sid uint64, m7 *KeyGenMsg7) error
- func (p *Party2) PrivateKey() (*Party2PrivateKey, error)
- type Party2PrivateKey
- type Party2SSSignCtx
- func (p *Party2SSSignCtx) SSSignMsgPhase2(sid uint64, m1 *SSSignMsg1) (*SSSignMsg2, error)
- func (p *Party2SSSignCtx) SSSignMsgPhase4(sid uint64, m3 *SSSignMsg3) (*SSSignMsg4, error)
- func (p *Party2SSSignCtx) SSSignMsgPhase6(sid uint64, m5 *SSSignMsg5) (*btcec.Signature, error)
- func (c *Party2SSSignCtx) Zero()
- type Party2SignCtx
- type ProofPair
- type RangeProof
- type RangeProofProver
- type RangeProofVerifier
- type SSSignMsg1
- type SSSignMsg2
- type SSSignMsg3
- type SSSignMsg4
- type SSSignMsg5
- type SecretPair
- type SignMsg1
- type SignMsg2
- type SignMsg3
- type SignMsg4
- type Uint256
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidOTMac = errors.New("invalid one-time MAC") ErrFinalKeyMismatch = errors.New("final OT key doesn't match") ErrKeyNotGenerated = errors.New("private key has not been generated") )
View Source
var ( ErrInvalidRangeProof = errors.New("invalid range proof") ErrInvalidProofPair = errors.New("cannot prove for invalid proof pair") )
View Source
var ErrInvalidCommitment = errors.New("invalid commitment")
View Source
var ErrInvalidPoK = errors.New("invalid proof of knowledge")
View Source
var ErrInvalidPreSignature = errors.New("invalid pre-signature")
View Source
var (
ErrInvalidPrimalityProof = errors.New(
"invalid paillier public key primality proof",
)
)
View Source
var ErrInvalidSignature = errors.New("invalid presignature created")
Functions ¶
Types ¶
type CiphertextPair ¶
func NewCiphertextPairs ¶
func NewCiphertextPairs(size int) []CiphertextPair
type KeyGenMsg1 ¶
type KeyGenMsg1 struct {
X1PoKComm Comm
}
type KeyGenMsg2 ¶
type KeyGenMsg3 ¶
type KeyGenMsg3 struct { X1PoK *DLogPoK X1PoKNonce Nonce PProof *PaillierNthRootProof RPCtxtPairs []CiphertextPair // contains filtered or unexported fields }
type KeyGenMsg4 ¶
type KeyGenMsg5 ¶
type KeyGenMsg7 ¶
type KeyGenMsg7 struct { AlphaPK *eckey.CompressedPublicKey AlphaNonce Nonce }
type PaillierNthRootProof ¶
type PaillierNthRootProof struct { PK *paillier.PublicKey U *big.Int A *big.Int Z *big.Int SecBits int }
func ProvePaillierNthRoot ¶
func ProvePaillierNthRoot( pk *paillier.PublicKey, secbits int) (*PaillierNthRootProof, error)
func (*PaillierNthRootProof) Verify ¶
func (p *PaillierNthRootProof) Verify() error
type Party1 ¶
type Party1 struct { X1 *eckey.PublicKey X1PoK *DLogPoK X1Nonce Nonce // Keygen phase 3 X2 *eckey.PublicKey PSK *paillier.PrivateKey CKey *big.Int CKeyNonce *big.Int RPProver *RangeProofProver // Keygen phase 5 ABComm Comm Alpha *big.Int AlphaPK *eckey.CompressedPublicKey AlphaNonce Nonce //Keygen phase 7 Q *eckey.PublicKey // contains filtered or unexported fields }
func (*Party1) KeyGenPhase1 ¶
func (p *Party1) KeyGenPhase1( sid uint64) (*KeyGenMsg1, error)
func (*Party1) KeyGenPhase3 ¶
func (p *Party1) KeyGenPhase3( sid uint64, m2 *KeyGenMsg2) (*KeyGenMsg3, error)
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)
type Party1PrivateKey ¶
type Party1PrivateKey struct { PSK *paillier.PrivateKey X1SK *eckey.SecretKey PublicKey *btcec.PublicKey // contains filtered or unexported fields }
func (*Party1PrivateKey) NewSSSignCtx ¶
func (sk *Party1PrivateKey) NewSSSignCtx( msg []byte, T *eckey.CompressedPublicKey) *Party1SSSignCtx
func (*Party1PrivateKey) NewSignCtx ¶
func (sk *Party1PrivateKey) NewSignCtx(msg []byte) *Party1SignCtx
func (*Party1PrivateKey) ScriptlessSign ¶
func (sk1 *Party1PrivateKey) ScriptlessSign( msg []byte, t *eckey.SecretKey, sk2 *Party2PrivateKey) (*btcec.Signature, *eckey.SecretKey, error)
func (*Party1PrivateKey) Sign ¶
func (sk1 *Party1PrivateKey) Sign( msg []byte, sk2 *Party2PrivateKey) (*btcec.Signature, error)
type Party1SSSignCtx ¶
type Party1SSSignCtx struct { T *eckey.CompressedPublicKey R1 *eckey.PublicKey R1PoK *DLogPoK R1PoKNonce Nonce // Sign phase 3 R2 *eckey.PublicKey R3 *eckey.PublicKey // Sign phase 5 SDPrime *big.Int // contains filtered or unexported fields }
func (*Party1SSSignCtx) SSSignMsgPhase1 ¶
func (p *Party1SSSignCtx) SSSignMsgPhase1(sid uint64) (*SSSignMsg1, error)
func (*Party1SSSignCtx) SSSignMsgPhase3 ¶
func (p *Party1SSSignCtx) SSSignMsgPhase3( sid uint64, m2 *SSSignMsg2) (*SSSignMsg3, error)
func (*Party1SSSignCtx) SSSignMsgPhase5 ¶
func (p *Party1SSSignCtx) SSSignMsgPhase5( sid uint64, m4 *SSSignMsg4) (*SSSignMsg5, error)
func (*Party1SSSignCtx) Zero ¶
func (c *Party1SSSignCtx) Zero()
type Party1SignCtx ¶
type Party1SignCtx struct { R1 *eckey.PublicKey R1PoK *DLogPoK R1PoKNonce 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 (*Party1SignCtx) Zero ¶
func (c *Party1SignCtx) Zero()
type Party2 ¶
type Party2 struct { // Keygen phase 2 X1PoKComm Comm X2 *eckey.PublicKey X2PoK *DLogPoK RPVerifier *RangeProofVerifier // Keygen phase 4 X1 *eckey.PublicKey PPK *paillier.PublicKey CKey *big.Int CPrime *big.Int A *big.Int B *big.Int ABNonce Nonce // Keygen phase 6 AlphaComm Comm // Keygen phase 8 Q *eckey.PublicKey // contains filtered or unexported fields }
func (*Party2) KeyGenPhase2 ¶
func (p *Party2) KeyGenPhase2( sid uint64, m1 *KeyGenMsg1) (*KeyGenMsg2, error)
func (*Party2) KeyGenPhase4 ¶
func (p *Party2) KeyGenPhase4( sid uint64, m3 *KeyGenMsg3) (*KeyGenMsg4, error)
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 { PPK *paillier.PublicKey CKey *big.Int X2SK *eckey.SecretKey PublicKey *btcec.PublicKey // contains filtered or unexported fields }
func (*Party2PrivateKey) NewSSSignCtx ¶
func (sk *Party2PrivateKey) NewSSSignCtx( msg []byte, t *eckey.SecretKey, T *eckey.CompressedPublicKey) *Party2SSSignCtx
func (*Party2PrivateKey) NewSignCtx ¶
func (sk *Party2PrivateKey) NewSignCtx(msg []byte) *Party2SignCtx
type Party2SSSignCtx ¶
type Party2SSSignCtx struct { T *eckey.CompressedPublicKey // Sign phase 2 R1PoKComm Comm R2 *eckey.PublicKey R2PoK *DLogPoK R3PoK *DLogPoK // Sign phase 4 R1 *eckey.PublicKey // contains filtered or unexported fields }
func (*Party2SSSignCtx) SSSignMsgPhase2 ¶
func (p *Party2SSSignCtx) SSSignMsgPhase2( sid uint64, m1 *SSSignMsg1) (*SSSignMsg2, error)
func (*Party2SSSignCtx) SSSignMsgPhase4 ¶
func (p *Party2SSSignCtx) SSSignMsgPhase4( sid uint64, m3 *SSSignMsg3) (*SSSignMsg4, error)
func (*Party2SSSignCtx) SSSignMsgPhase6 ¶
func (p *Party2SSSignCtx) SSSignMsgPhase6( sid uint64, m5 *SSSignMsg5) (*btcec.Signature, error)
func (*Party2SSSignCtx) Zero ¶
func (c *Party2SSSignCtx) Zero()
type Party2SignCtx ¶
type Party2SignCtx struct { // Sign phase 2 R1PoKComm Comm R2 *eckey.PublicKey R2PoK *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 ProofPair ¶
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 Comm Accuracy int SecPairs []SecretPair CtxtPairs []CiphertextPair }
func NewRangeProofProver ¶
type RangeProofVerifier ¶
type RangeProofVerifier struct { C *big.Int PPK *paillier.PublicKey Q3 *big.Int Challenge BitSlice Comm Comm 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 SSSignMsg1 ¶
type SSSignMsg1 struct {
R1PoKComm Comm
}
type SSSignMsg2 ¶
type SSSignMsg3 ¶
type SSSignMsg4 ¶
type SSSignMsg4 struct {
// contains filtered or unexported fields
}
type SSSignMsg5 ¶
type SecretPair ¶
func NewSecretPairs ¶
func NewSecretPairs(size int) []SecretPair
Source Files ¶
Click to show internal directories.
Click to hide internal directories.