From 6db6d1e4c7c8568a865a110cc6fdc483f586ebcd Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Tue, 21 Dec 2021 13:19:44 -0500 Subject: [PATCH 01/33] EdDSA with the secp256k1 elliptic curve for Schnorr signatures and Taproot. Work in Progress. --- ecdsa/keygen/save_data.go | 6 +- eddsa/keygen/local_party_test.go | 186 +++++++++++++++++- eddsa/keygen/test_utils.go | 14 +- eddsa/signing/finalize.go | 125 +++++++++--- eddsa/signing/local_party.go | 32 +-- eddsa/signing/local_party_test.go | 120 ++++++++++- eddsa/signing/round_1.go | 2 +- eddsa/signing/round_3.go | 82 ++++++-- eddsa/signing/rounds.go | 2 +- go.mod | 14 +- go.sum | 62 +++--- test/_ecdsa_fixtures/keygen_data_0.json | 1 - test/_ecdsa_fixtures/keygen_data_1.json | 1 - test/_ecdsa_fixtures/keygen_data_2.json | 1 - test/_ecdsa_fixtures/keygen_data_3.json | 1 - test/_ecdsa_fixtures/keygen_data_4.json | 1 - .../keygen_data_Edwards_0.json | 1 + .../keygen_data_Edwards_1.json | 1 + .../keygen_data_Edwards_2.json | 1 + .../keygen_data_Edwards_3.json | 1 + .../keygen_data_Edwards_4.json | 1 + test/_eddsa_fixtures/keygen_data_S256_0.json | 1 + test/_eddsa_fixtures/keygen_data_S256_1.json | 1 + test/_eddsa_fixtures/keygen_data_S256_2.json | 1 + test/_eddsa_fixtures/keygen_data_S256_3.json | 1 + test/_eddsa_fixtures/keygen_data_S256_4.json | 1 + 26 files changed, 541 insertions(+), 119 deletions(-) delete mode 100644 test/_ecdsa_fixtures/keygen_data_0.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_1.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_2.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_3.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_4.json create mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_0.json create mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_1.json create mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_2.json create mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_3.json create mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_4.json create mode 100644 test/_eddsa_fixtures/keygen_data_S256_0.json create mode 100644 test/_eddsa_fixtures/keygen_data_S256_1.json create mode 100644 test/_eddsa_fixtures/keygen_data_S256_2.json create mode 100644 test/_eddsa_fixtures/keygen_data_S256_3.json create mode 100644 test/_eddsa_fixtures/keygen_data_S256_4.json diff --git a/ecdsa/keygen/save_data.go b/ecdsa/keygen/save_data.go index 4e51bca0..a01e20eb 100644 --- a/ecdsa/keygen/save_data.go +++ b/ecdsa/keygen/save_data.go @@ -8,9 +8,9 @@ package keygen import ( "encoding/hex" + "errors" "math/big" - "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" "github.com/binance-chain/tss-lib/crypto/paillier" "github.com/binance-chain/tss-lib/tss" @@ -68,7 +68,7 @@ func (preParams LocalPreParams) Validate() bool { func (preParams LocalPreParams) ValidateWithProof() bool { return preParams.Validate() && - //preParams.Alpha != nil && + // preParams.Alpha != nil && preParams.Beta != nil && preParams.P != nil && preParams.Q != nil @@ -87,7 +87,7 @@ func BuildLocalSaveDataSubset(sourceData LocalPartySaveData, sortedIDs tss.Sorte for j, id := range sortedIDs { savedIdx, ok := keysToIndices[hex.EncodeToString(id.Key)] if !ok { - common.Logger.Warning("BuildLocalSaveDataSubset: unable to find a signer party in the local save data", id) + panic(errors.New("BuildLocalSaveDataSubset: unable to find a signer party in the local save data")) } newData.Ks[j] = sourceData.Ks[savedIdx] newData.NTildej[j] = sourceData.NTildej[savedIdx] diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index 7957657b..f370505b 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -16,6 +16,8 @@ import ( "testing" "github.com/decred/dcrd/dcrec/edwards/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v2/schnorr" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" @@ -37,11 +39,11 @@ func setUp(level string) { } } -func TestE2EConcurrentAndSaveFixtures(t *testing.T) { +func TestE2EConcurrentAndSaveFixturesEdwards(t *testing.T) { setUp("info") threshold := testThreshold - fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants) + fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants, "Edwards") if err != nil { common.Logger.Info("No test fixtures were found, so the safe primes will be generated from scratch. This may take a while...") pIDs = tss.GenerateTestPartyIDs(testParticipants) @@ -61,7 +63,7 @@ func TestE2EConcurrentAndSaveFixtures(t *testing.T) { // init the parties for i := 0; i < len(pIDs); i++ { var P *LocalParty - params := tss.NewParameters(tss.Edwards(), p2pCtx, pIDs[i], len(pIDs), threshold) + params := tss.NewParameters(tss.Edwards(), p2pCtx, pIDs[i], len(pIDs), threshold) // TODO if i < len(fixtures) { P = NewLocalParty(params, outCh, endCh).(*LocalParty) } else { @@ -108,7 +110,7 @@ keygen: // .. here comes a workaround to recover this party's index (it was removed from save data) index, err := save.OriginalIndex() assert.NoErrorf(t, err, "should not be an error getting a party's index from save data") - tryWriteTestFixtureFile(t, index, save) + tryWriteTestFixtureFile(t, index, "Edwards", save) atomic.AddInt32(&ended, 1) if atomic.LoadInt32(&ended) == int32(len(pIDs)) { @@ -209,8 +211,180 @@ keygen: } } -func tryWriteTestFixtureFile(t *testing.T, index int, data LocalPartySaveData) { - fixtureFileName := makeTestFixtureFilePath(index) +func TestE2EConcurrentAndSaveFixturesS256Schnorr(t *testing.T) { + setUp("info") + + threshold := testThreshold + fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants, "S256") + if err != nil { + common.Logger.Info("No test fixtures were found, so the safe primes will be generated from scratch. This may take a while...") + pIDs = tss.GenerateTestPartyIDs(testParticipants) + } + + p2pCtx := tss.NewPeerContext(pIDs) + parties := make([]*LocalParty, 0, len(pIDs)) + + errCh := make(chan *tss.Error, len(pIDs)) + outCh := make(chan tss.Message, len(pIDs)) + endCh := make(chan LocalPartySaveData, len(pIDs)) + + updater := test.SharedPartyUpdater + + startGR := runtime.NumGoroutine() + + // init the parties + for i := 0; i < len(pIDs); i++ { + var P *LocalParty + params := tss.NewParameters(tss.S256(), p2pCtx, pIDs[i], len(pIDs), threshold) + if i < len(fixtures) { + P = NewLocalParty(params, outCh, endCh).(*LocalParty) + } else { + P = NewLocalParty(params, outCh, endCh).(*LocalParty) + } + parties = append(parties, P) + go func(P *LocalParty) { + if err := P.Start(); err != nil { + errCh <- err + } + }(P) + } + + // PHASE: keygen + var ended int32 +keygen: + for { + fmt.Printf("ACTIVE GOROUTINES: %d\n", runtime.NumGoroutine()) + select { + case err := <-errCh: + common.Logger.Errorf("Error: %s", err) + assert.FailNow(t, err.Error()) + break keygen + + case msg := <-outCh: + dest := msg.GetTo() + if dest == nil { // broadcast! + for _, P := range parties { + if P.PartyID().Index == msg.GetFrom().Index { + continue + } + go updater(P, msg, errCh) + } + } else { // point-to-point! + if dest[0].Index == msg.GetFrom().Index { + t.Fatalf("party %d tried to send a message to itself (%d)", dest[0].Index, msg.GetFrom().Index) + return + } + go updater(parties[dest[0].Index], msg, errCh) + } + + case save := <-endCh: + // SAVE a test fixture file for this P (if it doesn't already exist) + // .. here comes a workaround to recover this party's index (it was removed from save data) + index, err := save.OriginalIndex() + assert.NoErrorf(t, err, "should not be an error getting a party's index from save data") + tryWriteTestFixtureFile(t, index, "S256", save) + + atomic.AddInt32(&ended, 1) + if atomic.LoadInt32(&ended) == int32(len(pIDs)) { + t.Logf("Done. Received save data from %d participants", ended) + + // combine shares for each Pj to get u + u := new(big.Int) + for j, Pj := range parties { + pShares := make(vss.Shares, 0) + for j2, P := range parties { + if j2 == j { + continue + } + vssMsgs := P.temp.kgRound2Message1s + share := vssMsgs[j].Content().(*KGRound2Message1).Share + shareStruct := &vss.Share{ + Threshold: threshold, + ID: P.PartyID().KeyInt(), + Share: new(big.Int).SetBytes(share), + } + pShares = append(pShares, shareStruct) + } + uj, err := pShares[:threshold+1].ReConstruct(tss.S256()) + assert.NoError(t, err, "vss.ReConstruct should not throw error") + + // uG test: u*G[j] == V[0] + assert.Equal(t, uj, Pj.temp.ui) + uG := crypto.ScalarBaseMult(tss.S256(), uj) + assert.True(t, uG.Equals(Pj.temp.vs[0]), "ensure u*G[j] == V_0") + + // xj tests: BigXj == xj*G + xj := Pj.data.Xi + gXj := crypto.ScalarBaseMult(tss.S256(), xj) + BigXj := Pj.data.BigXj[j] + assert.True(t, BigXj.Equals(gXj), "ensure BigX_j == g^x_j") + + // fails if threshold cannot be satisfied (bad share) + { + badShares := pShares[:threshold] + badShares[len(badShares)-1].Share.Set(big.NewInt(0)) + uj, err := pShares[:threshold].ReConstruct(tss.S256()) + assert.NoError(t, err) + assert.NotEqual(t, parties[j].temp.ui, uj) + BigXjX, BigXjY := tss.S256().ScalarBaseMult(uj.Bytes()) + assert.NotEqual(t, BigXjX, Pj.temp.vs[0].X()) + assert.NotEqual(t, BigXjY, Pj.temp.vs[0].Y()) + } + u = new(big.Int).Add(u, uj) + } + u = new(big.Int).Mod(u, tss.S256().Params().N) + scalar := make([]byte, 0, 32) + copy(scalar, u.Bytes()) + + // build eddsa key pair + pkX, pkY := save.EDDSAPub.X(), save.EDDSAPub.Y() + pk := secp256k1.PublicKey{ + Curve: tss.S256(), + X: pkX, + Y: pkY, + } + println("u len: ", len(u.Bytes())) + sk, _ := secp256k1.PrivKeyFromScalar(u.Bytes()) + // fmt.Println("err: ", err.Error()) + + // test pub key, should be on curve and match pkX, pkY + assert.True(t, pk.IsOnCurve(pkX, pkY), "public key must be on curve") + + // public key tests + assert.NotZero(t, u, "u should not be zero") + ourPkX, ourPkY := tss.S256().ScalarBaseMult(u.Bytes()) + assert.Equal(t, pkX, ourPkX, "pkX should match expected pk derived from u") + assert.Equal(t, pkY, ourPkY, "pkY should match expected pk derived from u") + t.Log("Public key tests done.") + + // make sure everyone has the same EdDSA public key + for _, Pj := range parties { + assert.Equal(t, pkX, Pj.data.EDDSAPub.X()) + assert.Equal(t, pkY, Pj.data.EDDSAPub.Y()) + } + t.Log("Public key distribution test done.") + + // test sign/verify + data := make([]byte, 32) + for i := range data { + data[i] = byte(i) + } + r, s, err := schnorr.Sign(sk, data) + assert.NoError(t, err, "sign should not throw an error") + ok := schnorr.Verify(&pk, data, r, s) + assert.True(t, ok, "signature should be ok") + t.Log("EdDSA signing test done.") + + t.Logf("Start goroutines: %d, End goroutines: %d", startGR, runtime.NumGoroutine()) + + break keygen + } + } + } +} + +func tryWriteTestFixtureFile(t *testing.T, index int, testSetId string, data LocalPartySaveData) { + fixtureFileName := makeTestFixtureFilePath(testSetId, index) // fixture file does not already exist? // if it does, we won't re-create it here diff --git a/eddsa/keygen/test_utils.go b/eddsa/keygen/test_utils.go index a4655f70..9994aa41 100644 --- a/eddsa/keygen/test_utils.go +++ b/eddsa/keygen/test_utils.go @@ -29,17 +29,17 @@ const ( ) const ( testFixtureDirFormat = "%s/../../test/_eddsa_fixtures" - testFixtureFileFormat = "keygen_data_%d.json" + testFixtureFileFormat = "keygen_data_%s_%d.json" ) -func LoadKeygenTestFixtures(qty int, optionalStart ...int) ([]LocalPartySaveData, tss.SortedPartyIDs, error) { +func LoadKeygenTestFixtures(qty int, testSetId string, optionalStart ...int) ([]LocalPartySaveData, tss.SortedPartyIDs, error) { keys := make([]LocalPartySaveData, 0, qty) start := 0 if 0 < len(optionalStart) { start = optionalStart[0] } for i := start; i < qty; i++ { - fixtureFilePath := makeTestFixtureFilePath(i) + fixtureFilePath := makeTestFixtureFilePath(testSetId, i) bz, err := ioutil.ReadFile(fixtureFilePath) if err != nil { return nil, nil, errors.Wrapf(err, @@ -67,7 +67,7 @@ func LoadKeygenTestFixtures(qty int, optionalStart ...int) ([]LocalPartySaveData return keys, sortedPIDs, nil } -func LoadKeygenTestFixturesRandomSet(qty, fixtureCount int) ([]LocalPartySaveData, tss.SortedPartyIDs, error) { +func LoadKeygenTestFixturesRandomSet(qty, fixtureCount int, testSetId string) ([]LocalPartySaveData, tss.SortedPartyIDs, error) { keys := make([]LocalPartySaveData, 0, qty) plucked := make(map[int]interface{}, qty) for i := 0; len(plucked) < qty; i = (i + 1) % fixtureCount { @@ -77,7 +77,7 @@ func LoadKeygenTestFixturesRandomSet(qty, fixtureCount int) ([]LocalPartySaveDat } } for i := range plucked { - fixtureFilePath := makeTestFixtureFilePath(i) + fixtureFilePath := makeTestFixtureFilePath(testSetId, i) bz, err := ioutil.ReadFile(fixtureFilePath) if err != nil { return nil, nil, errors.Wrapf(err, @@ -109,9 +109,9 @@ func LoadKeygenTestFixturesRandomSet(qty, fixtureCount int) ([]LocalPartySaveDat return keys, sortedPIDs, nil } -func makeTestFixtureFilePath(partyIndex int) string { +func makeTestFixtureFilePath(testSetId string, partyIndex int) string { _, callerFileName, _, _ := runtime.Caller(0) srcDirName := filepath.Dir(callerFileName) fixtureDirName := fmt.Sprintf(testFixtureDirFormat, srcDirName) - return fmt.Sprintf("%s/"+testFixtureFileFormat, fixtureDirName, partyIndex) + return fmt.Sprintf("%s/"+testFixtureFileFormat, fixtureDirName, testSetId, partyIndex) } diff --git a/eddsa/signing/finalize.go b/eddsa/signing/finalize.go index efb255e7..4cae256b 100644 --- a/eddsa/signing/finalize.go +++ b/eddsa/signing/finalize.go @@ -10,12 +10,15 @@ import ( "errors" "fmt" "math/big" + "strings" "github.com/agl/ed25519/edwards25519" - "github.com/decred/dcrd/dcrec/edwards/v2" - "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/tss" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr" + "github.com/decred/dcrd/dcrec/edwards/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v2" ) func (round *finalization) Start() *tss.Error { @@ -26,19 +29,39 @@ func (round *finalization) Start() *tss.Error { round.started = true round.resetOK() - sumS := round.temp.si - for j := range round.Parties().IDs() { - round.ok[j] = true - if j == round.PartyID().Index { - continue + ok := false + var s *big.Int + var sumS *[32]byte + common.Logger.Debugf("curve name: %v", round.Params().EC().Params().Name) + if _, ok = round.Params().EC().(*edwards.TwistedEdwardsCurve); ok { + sumS = round.temp.si + for j := range round.Parties().IDs() { + round.ok[j] = true + if j == round.PartyID().Index { + continue + } + r3msg := round.temp.signRound3Messages[j].Content().(*SignRound3Message) + sjBytes := bigIntToEncodedBytes(r3msg.UnmarshalS()) + var tmpSumS [32]byte + edwards25519.ScMulAdd(&tmpSumS, sumS, bigIntToEncodedBytes(big.NewInt(1)), sjBytes) + + sumS = &tmpSumS } - r3msg := round.temp.signRound3Messages[j].Content().(*SignRound3Message) - sjBytes := bigIntToEncodedBytes(r3msg.UnmarshalS()) - var tmpSumS [32]byte - edwards25519.ScMulAdd(&tmpSumS, sumS, bigIntToEncodedBytes(big.NewInt(1)), sjBytes) - sumS = &tmpSumS + s = encodedBytesToBigInt(sumS) + } else if strings.Compare("secp256k1", round.Params().EC().Params().Name) == 0 { + sumSInt := encodedBytesToBigInt(round.temp.si) + modN := common.ModInt(tss.S256().Params().N) + for j := range round.Parties().IDs() { + round.ok[j] = true + if j == round.PartyID().Index { + continue + } + r3msg := round.temp.signRound3Messages[j].Content().(*SignRound3Message) + sumSInt = modN.Add(sumSInt, r3msg.UnmarshalS()) + } + s = sumSInt + sumS = bigIntToEncodedBytes(sumSInt) } - s := encodedBytesToBigInt(sumS) // save the signature for final output signature := new(common.ECSignature) @@ -51,16 +74,35 @@ func (round *finalization) Start() *tss.Error { round.data.S = signature.S round.data.Signature = append(round.data.R, round.data.S...) - pk := edwards.PublicKey{ - Curve: round.Params().EC(), - X: round.key.EDDSAPub.X(), - Y: round.key.EDDSAPub.Y(), + if _, ok = round.Params().EC().(*edwards.TwistedEdwardsCurve); ok { + pk := edwards.PublicKey{ + Curve: round.Params().EC(), + X: round.key.EDDSAPub.X(), + Y: round.key.EDDSAPub.Y(), + } + common.Logger.Debugf("pk.X: %v, r: %v, s: %s", pk.X, round.temp.r, s) + ok = edwards.Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) + if !ok { + return round.WrapError(fmt.Errorf("edwards signature verification failed")) + } + } else if strings.Compare("secp256k1", round.Params().EC().Params().Name) == 0 { + pk := secp256k1.PublicKey{ + Curve: round.Params().EC(), + X: round.key.EDDSAPub.X(), + Y: round.key.EDDSAPub.Y(), + } + common.Logger.Debugf("pk.X: %v, r: %v, s: %s, #m: %v", common.FormatBigInt(pk.X), + common.FormatBigInt(round.temp.r), + common.FormatBigInt(s), len(round.temp.m.Bytes())) + ok = Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) + common.Logger.Debugf("pk.X: %v, r: %v, s: %s, #m: %v, verify ok? %v", common.FormatBigInt(pk.X), + common.FormatBigInt(round.temp.r), + common.FormatBigInt(s), len(round.temp.m.Bytes()), ok) + if !ok { + return round.WrapError(fmt.Errorf("schnorr signature verification failed")) + } } - ok := edwards.Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) - if !ok { - return round.WrapError(fmt.Errorf("signature verification failed")) - } round.end <- *round.data return nil @@ -80,12 +122,39 @@ func (round *finalization) NextRound() tss.Round { return nil // finished! } -func padToLengthBytesInPlace(src []byte, length int) []byte { - oriLen := len(src) - if oriLen < length { - for i := 0; i < length-oriLen; i++ { - src = append([]byte{0}, src...) - } +func Verify(p *secp256k1.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { + var r btcec.FieldVal + var s btcec.ModNScalar + r.SetByteSlice(r_.Bytes()) + s.SetByteSlice(s_.Bytes()) + signature := schnorr.NewSignature(&r, &s) + var x, y btcec.FieldVal + x.SetByteSlice(p.X.Bytes()) + y.SetByteSlice(p.Y.Bytes()) + pk := btcec.NewPublicKey(&x, &y) + // + // TODO pubKey, err := ParsePubKey(pk.SerializeCompressed()[1:]) + // + return signature.Verify(m, pk) +} + +// ParsePubKey TODO DELETE +func ParsePubKey(pubKeyStr []byte) (*btcec.PublicKey, error) { + if pubKeyStr == nil { + err := fmt.Errorf("nil pubkey byte string") + return nil, err + } + if len(pubKeyStr) != 32 { + err := fmt.Errorf("bad pubkey byte string size (want %v, have %v)", + 32, len(pubKeyStr)) + return nil, err } - return src + + // We'll manually prepend the compressed byte so we can re-use the + // existing pubkey parsing routine of the main btcec package. + var keyCompressed [btcec.PubKeyBytesLenCompressed]byte + keyCompressed[0] = btcec.PubKeyFormatCompressedEven + copy(keyCompressed[1:], pubKeyStr) + + return btcec.ParsePubKey(keyCompressed[:]) } diff --git a/eddsa/signing/local_party.go b/eddsa/signing/local_party.go index ee765389..630e5b81 100644 --- a/eddsa/signing/local_party.go +++ b/eddsa/signing/local_party.go @@ -9,6 +9,7 @@ package signing import ( "errors" "fmt" + "hash" "math/big" "github.com/binance-chain/tss-lib/common" @@ -23,10 +24,17 @@ import ( var _ tss.Party = (*LocalParty)(nil) var _ fmt.Stringer = (*LocalParty)(nil) +type HashingAlgorithm int + type ( + EdDSAParameters struct { + *tss.Parameters + hashingAlgorithm hash.Hash + } + LocalParty struct { *tss.BaseParty - params *tss.Parameters + edDSAParams *EdDSAParameters keys keygen.LocalPartySaveData temp localTempData @@ -64,20 +72,20 @@ type ( func NewLocalParty( msg *big.Int, - params *tss.Parameters, + params *EdDSAParameters, key keygen.LocalPartySaveData, out chan<- tss.Message, end chan<- common.SignatureData, ) tss.Party { partyCount := len(params.Parties().IDs()) p := &LocalParty{ - BaseParty: new(tss.BaseParty), - params: params, - keys: keygen.BuildLocalSaveDataSubset(key, params.Parties().IDs()), - temp: localTempData{}, - data: common.SignatureData{}, - out: out, - end: end, + BaseParty: new(tss.BaseParty), + edDSAParams: params, + keys: keygen.BuildLocalSaveDataSubset(key, params.Parties().IDs()), + temp: localTempData{}, + data: common.SignatureData{}, + out: out, + end: end, } // msgs init p.temp.signRound1Messages = make([]tss.ParsedMessage, partyCount) @@ -91,7 +99,7 @@ func NewLocalParty( } func (p *LocalParty) FirstRound() tss.Round { - return newRound1(p.params, &p.keys, &p.data, &p.temp, p.out, p.end) + return newRound1(p.edDSAParams, &p.keys, &p.data, &p.temp, p.out, p.end) } func (p *LocalParty) Start() *tss.Error { @@ -124,7 +132,7 @@ func (p *LocalParty) ValidateMessage(msg tss.ParsedMessage) (bool, *tss.Error) { return false, p.WrapError(fmt.Errorf("received msg with an invalid sender: %s", msg)) } // check that the message's "from index" will fit into the array - if maxFromIdx := len(p.params.Parties().IDs()) - 1; maxFromIdx < msg.GetFrom().Index { + if maxFromIdx := len(p.edDSAParams.Parties().IDs()) - 1; maxFromIdx < msg.GetFrom().Index { return false, p.WrapError(fmt.Errorf("received msg with a sender index too great (%d <= %d)", maxFromIdx, msg.GetFrom().Index), msg.GetFrom()) } @@ -158,7 +166,7 @@ func (p *LocalParty) StoreMessage(msg tss.ParsedMessage) (bool, *tss.Error) { } func (p *LocalParty) PartyID() *tss.PartyID { - return p.params.PartyID() + return p.edDSAParams.PartyID() } func (p *LocalParty) String() string { diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index 5f71e01f..31114698 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -7,11 +7,17 @@ package signing import ( + "crypto/sha512" + "encoding/hex" + "fmt" "math/big" "sync/atomic" "testing" "github.com/agl/ed25519/edwards25519" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr" + "github.com/decred/dcrd/crypto/blake256" "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" @@ -33,15 +39,14 @@ func setUp(level string) { } } -func TestE2EConcurrent(t *testing.T) { +func TestE2EConcurrentEdwards(t *testing.T) { setUp("debug") - - // tss.SetCurve(edwards.Edwards()) deprecated + t.Skip("Skipping this test for now - TODO") threshold := testThreshold // PHASE: load keygen fixtures - keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants) + keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants, "S256") assert.NoError(t, err, "should load keygen fixtures") assert.Equal(t, testThreshold+1, len(keys)) assert.Equal(t, testThreshold+1, len(signPIDs)) @@ -62,7 +67,8 @@ func TestE2EConcurrent(t *testing.T) { for i := 0; i < len(signPIDs); i++ { params := tss.NewParameters(edwards.Edwards(), p2pCtx, signPIDs[i], len(signPIDs), threshold) - P := NewLocalParty(msg, params, keys[i], outCh, endCh).(*LocalParty) + edDSAParameters := &EdDSAParameters{Parameters: params, hashingAlgorithm: sha512.New()} + P := NewLocalParty(msg, edDSAParameters, keys[i], outCh, endCh).(*LocalParty) parties = append(parties, P) go func(P *LocalParty) { if err := P.Start(); err != nil { @@ -147,3 +153,107 @@ signing: } } } + +func TestE2EConcurrentS256Schnorr(t *testing.T) { + setUp("debug") + t.Skip("Skipping this test for now - TODO") + + threshold := testThreshold + + // PHASE: load keygen fixtures + keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants, "S256") + assert.NoError(t, err, "should load keygen fixtures") + assert.Equal(t, testThreshold+1, len(keys)) + assert.Equal(t, testThreshold+1, len(signPIDs)) + + // PHASE: signing + + p2pCtx := tss.NewPeerContext(signPIDs) + parties := make([]*LocalParty, 0, len(signPIDs)) + + errCh := make(chan *tss.Error, len(signPIDs)) + outCh := make(chan tss.Message, len(signPIDs)) + endCh := make(chan common.SignatureData, len(signPIDs)) + + updater := test.SharedPartyUpdater + + msg_, _ := hex.DecodeString("304502210088BE0644191B935DB1CD786B43FF27798006578D8C908906B49E89") // big.NewInt(200).Bytes() + msg := big.NewInt(0).SetBytes(msg_) + + // init the parties + for i := 0; i < len(signPIDs); i++ { + params := tss.NewParameters(tss.S256(), p2pCtx, signPIDs[i], len(signPIDs), threshold) + edDSAParameters := &EdDSAParameters{Parameters: params, hashingAlgorithm: blake256.New()} + + P := NewLocalParty(msg, edDSAParameters, keys[i], outCh, endCh).(*LocalParty) + parties = append(parties, P) + go func(P *LocalParty) { + if err := P.Start(); err != nil { + errCh <- err + } + }(P) + } + + var ended int32 +signing: + for { + select { + case err := <-errCh: + common.Logger.Errorf("Error: %s", err) + assert.FailNow(t, err.Error()) + break signing + + case msg := <-outCh: + dest := msg.GetTo() + if dest == nil { + for _, P := range parties { + if P.PartyID().Index == msg.GetFrom().Index { + continue + } + go updater(P, msg, errCh) + } + } else { + if dest[0].Index == msg.GetFrom().Index { + t.Fatalf("party %d tried to send a message to itself (%d)", dest[0].Index, msg.GetFrom().Index) + } + go updater(parties[dest[0].Index], msg, errCh) + } + + case <-endCh: + atomic.AddInt32(&ended, 1) + if atomic.LoadInt32(&ended) == int32(len(signPIDs)) { + t.Logf("Done. Received save data from %d participants", ended) + R := parties[0].temp.r + + modN := common.ModInt(tss.S256().Params().N) + + // BEGIN check s correctness + sumS := big.NewInt(0) + for _, p := range parties { + sumS = modN.Add(sumS, encodedBytesToBigInt(p.temp.si)) + } + fmt.Printf("S: %s\n", common.FormatBigInt(sumS)) + fmt.Printf("R: %s\n", R.String()) + // END check s correctness + + // BEGIN EdDSA verify + pkX, pkY := keys[0].EDDSAPub.X(), keys[0].EDDSAPub.Y() + var r btcec.FieldVal + var s btcec.ModNScalar + r.SetByteSlice(parties[0].data.GetR()) + s.SetByteSlice(parties[0].data.GetS()) + signature := schnorr.NewSignature(&r, &s) + var x, y btcec.FieldVal + x.SetByteSlice(pkX.Bytes()) + y.SetByteSlice(pkY.Bytes()) + pk := btcec.NewPublicKey(&x, &y) + ok := signature.Verify(msg_, pk) + assert.True(t, ok, "eddsa verify must pass") + t.Log("EdDSA signing test done.") + // END EdDSA verify + + break signing + } + } + } +} diff --git a/eddsa/signing/round_1.go b/eddsa/signing/round_1.go index e176da5a..74ef64a0 100644 --- a/eddsa/signing/round_1.go +++ b/eddsa/signing/round_1.go @@ -23,7 +23,7 @@ var ( ) // round 1 represents round 1 of the signing part of the EDDSA TSS spec -func newRound1(params *tss.Parameters, key *keygen.LocalPartySaveData, data *common.SignatureData, temp *localTempData, out chan<- tss.Message, end chan<- common.SignatureData) tss.Round { +func newRound1(params *EdDSAParameters, key *keygen.LocalPartySaveData, data *common.SignatureData, temp *localTempData, out chan<- tss.Message, end chan<- common.SignatureData) tss.Round { return &round1{ &base{params, key, data, temp, out, end, make([]bool, len(params.Parties().IDs())), false, 1}} } diff --git a/eddsa/signing/round_3.go b/eddsa/signing/round_3.go index 42950c62..6688256a 100644 --- a/eddsa/signing/round_3.go +++ b/eddsa/signing/round_3.go @@ -7,9 +7,14 @@ package signing import ( - "crypto/sha512" + "encoding/hex" + "math/big" + "strings" "github.com/agl/ed25519/edwards25519" + "github.com/binance-chain/tss-lib/common" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/pkg/errors" "github.com/binance-chain/tss-lib/crypto" @@ -27,9 +32,18 @@ func (round *round3) Start() *tss.Error { round.resetOK() // 1. init R - var R edwards25519.ExtendedGroupElement - riBytes := bigIntToEncodedBytes(round.temp.ri) - edwards25519.GeScalarMultBase(&R, riBytes) + var Redwards edwards25519.ExtendedGroupElement + var Rsecp256k1 *crypto.ECPoint + + var riBytes *[32]byte + _, isTwistedEdwardsCurve := round.Params().EC().(*edwards.TwistedEdwardsCurve) + isSecp256k1Curve := strings.Compare("secp256k1", round.Params().EC().Params().Name) == 0 + if isTwistedEdwardsCurve { + riBytes = bigIntToEncodedBytes(round.temp.ri) + edwards25519.GeScalarMultBase(&Redwards, riBytes) + } else if isSecp256k1Curve { + Rsecp256k1 = crypto.ScalarBaseMult(round.Params().EC(), round.temp.ri) + } // 2-6. compute R i := round.PartyID().Index @@ -62,30 +76,60 @@ func (round *round3) Start() *tss.Error { return round.WrapError(errors.New("failed to prove Rj"), Pj) } - extendedRj := ecPointToExtendedElement(round.Params().EC(), Rj.X(), Rj.Y()) - R = addExtendedElements(R, extendedRj) + if isTwistedEdwardsCurve { + extendedRj := ecPointToExtendedElement(round.Params().EC(), Rj.X(), Rj.Y()) + Redwards = addExtendedElements(Redwards, extendedRj) + } else if isSecp256k1Curve { + Rsecp256k1, err = Rsecp256k1.Add(Rj) + if err != nil { + return round.WrapError(errors.Wrapf(err, "error with addition"), Pj) + } + } } // 7. compute lambda var encodedR [32]byte - R.ToBytes(&encodedR) - encodedPubKey := ecPointToEncodedBytes(round.key.EDDSAPub.X(), round.key.EDDSAPub.Y()) + var encodedPubKey *[32]byte + + if isTwistedEdwardsCurve { + Redwards.ToBytes(&encodedR) + encodedPubKey = ecPointToEncodedBytes(round.key.EDDSAPub.X(), round.key.EDDSAPub.Y()) + } else if isSecp256k1Curve { + s := new([32]byte) + round.key.EDDSAPub.X().FillBytes(s[:]) + serializeR(Rsecp256k1, &encodedR) + common.Logger.Debugf("r3, encodedR: %s", hex.EncodeToString(encodedR[:])) + encodedPubKey = s + } // h = hash512(k || A || M) - h := sha512.New() - h.Reset() - h.Write(encodedR[:]) - h.Write(encodedPubKey[:]) - h.Write(round.temp.m.Bytes()) - var lambda [64]byte - h.Sum(lambda[:0]) var lambdaReduced [32]byte - edwards25519.ScReduce(&lambdaReduced, &lambda) + if isTwistedEdwardsCurve { + h := round.EdDSAParameters.hashingAlgorithm + h.Reset() + h.Write(encodedR[:]) + h.Write(encodedPubKey[:]) + h.Write(round.temp.m.Bytes()) + h.Sum(lambda[:0]) + + edwards25519.ScReduce(&lambdaReduced, &lambda) + } else if isSecp256k1Curve { + 𝜆 := chainhash.TaggedHash( + []byte("BIP0340/challenge"), encodedR[:], encodedPubKey[:], round.temp.m.Bytes(), + ) + copy(lambda[:0], 𝜆.CloneBytes()) + } // 8. compute si var localS [32]byte - edwards25519.ScMulAdd(&localS, &lambdaReduced, bigIntToEncodedBytes(round.temp.wi), riBytes) + if isTwistedEdwardsCurve { + edwards25519.ScMulAdd(&localS, &lambdaReduced, bigIntToEncodedBytes(round.temp.wi), riBytes) + } else if isSecp256k1Curve { + 𝜆wi := big.NewInt(0).Mul(big.NewInt(0).SetBytes(lambda[:0]), round.temp.wi) + si := big.NewInt(0).Add(round.temp.ri, 𝜆wi) + localS = *bigIntToEncodedBytes(si) + } // 9. store r3 message pieces round.temp.si = &localS @@ -112,6 +156,10 @@ func (round *round3) Update() (bool, *tss.Error) { return true, nil } +func serializeR(Rsecp256k1 *crypto.ECPoint, encodedR *[32]byte) { + Rsecp256k1.X().FillBytes(encodedR[:]) +} + func (round *round3) CanAccept(msg tss.ParsedMessage) bool { if _, ok := msg.Content().(*SignRound3Message); ok { return msg.IsBroadcast() diff --git a/eddsa/signing/rounds.go b/eddsa/signing/rounds.go index 4cb7c91b..2c664148 100644 --- a/eddsa/signing/rounds.go +++ b/eddsa/signing/rounds.go @@ -18,7 +18,7 @@ const ( type ( base struct { - *tss.Parameters + *EdDSAParameters key *keygen.LocalPartySaveData data *common.SignatureData temp *localTempData diff --git a/go.mod b/go.mod index 37b4a854..f4fb20da 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,16 @@ module github.com/binance-chain/tss-lib -go 1.15 +go 1.17 require ( - github.com/Workiva/go-datastructures v1.0.52 github.com/agl/ed25519 v0.0.0-20200225211852-fd4d107ace12 github.com/btcsuite/btcd v0.22.0-beta - github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce + github.com/btcsuite/btcd/btcec/v2 v2.0.0-00010101000000-000000000000 + github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd + github.com/decred/dcrd/crypto/blake256 v1.0.0 github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 + github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 + // github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 github.com/golang/protobuf v1.5.2 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 @@ -23,7 +26,6 @@ require ( go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.19.1 // indirect golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 // indirect golang.org/x/text v0.3.6 google.golang.org/protobuf v1.27.1 @@ -31,3 +33,7 @@ require ( ) replace github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 + +replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20211206001652-70ae843c3628 + +replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20211206001652-70ae843c3628 diff --git a/go.sum b/go.sum index 370b1699..23dbdcb9 100644 --- a/go.sum +++ b/go.sum @@ -1,38 +1,51 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/Roasbeef/btcd v0.0.0-20211206001652-70ae843c3628 h1:wxLzzEUuL9uqxSC3xZXDYRsR68qeMyqGgtiGft0CiZs= +github.com/Roasbeef/btcd v0.0.0-20211206001652-70ae843c3628/go.mod h1:soto1+lhdAeyw3o8yvHDREjF974Os5rjySL0Axwvztg= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20211206001652-70ae843c3628 h1:VcF+CVdEHANTqpoAGfbvf38rYyYyX/me2+IOvH2M1f0= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20211206001652-70ae843c3628/go.mod h1:5jOpKsF5fx4TqK0bnERSkf0umFmewBznJy82ji0rAgQ= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:Vkf7rtHx8uHx8gDfkQaCdVfc+gfrF9v6sR6xJy7RXNg= github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:TnVqVdGEK8b6erOMkcyYGWzCQMw7HEMCOw3BgFYCFWs= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= -github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= +github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd h1:vAwk2PCYxzUUGAXXtw66PyY2IMCwWBnm8GR5aLIxS3Q= +github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= +github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 h1:bX7rtGTMBDJxujZ29GNqtn7YCAdINjHKnA6J6tBBv6s= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -44,13 +57,11 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.4.0 h1:iR/2o9PGWanVJrBgIH5Ff8mPGOwpqLaPIAFqSnsdlzk= github.com/ipfs/go-log/v2 v2.4.0/go.mod h1:nPZnh7Cj7lwS3LpRU5Mwr2ol1c2gXIEXuF6aywqrtmo= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -70,13 +81,10 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/jsonindent v0.0.0-20171116142732-447bf004320b/go.mod h1:SXIpH2WO0dyF5YBc6Iq8jc8TEJYe1Fk2Rc1EVYUdIgY= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= @@ -115,42 +123,40 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -172,10 +178,8 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -198,8 +202,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= diff --git a/test/_ecdsa_fixtures/keygen_data_0.json b/test/_ecdsa_fixtures/keygen_data_0.json deleted file mode 100644 index b13138ee..00000000 --- a/test/_ecdsa_fixtures/keygen_data_0.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,"LambdaN":12244288467800177208539238462052011342254030771702255472147276750713378968968988427210056388820686206446187952378228367546099600631781506020763858317986651600624291548394114829197589558645045453881635603485584954584530436544720030519555440817257002069277532889886614496034158223545688636096849110387402387024528223628617374593769999264811588741432087970537480855839974072192640846465127734783052189068506929754332767063036832027419385620331463446206002989826208646900752477151275584044483720203684345006160252628954713743333528434400168081723633869350346509775917996401044899580728991601465887658618084552090225088074,"PhiN":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049056447257234749187539998529623177482864175941074961711679948144385281692930255469566104378137013859508665534126073664054838771240662926892412005979652417293801504954302551168088967440407368690012320505257909427486667056868800336163447267738700693019551835992802089799161457983202931775317236169104180450176148},"NTildei":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,"H1i":22231450562334471973618961742797616763434877603759536990055429171943655580664439279419958610772888014456353798981020361149135639525217821205425121486845662180390893935912842304490739461795526425936110185882557879383453966537438512163687673804582033522868345148763295767567221643994073486758870040420796087598143821022690141049410630612722219545247476715172769522813550748788268380178598324837703471829676064678228829702767153912677237945521290063086959482869616602461506402904230610340087208669128408849755792873299578530538374647998629096468609296430016568706541070523464581186829665248448703993586477544553956034821,"H2i":4903195124758783101014195122857885149885108217839819693509468695262427930011900534897220638698974555118369032111074317283371179147198752666772379003701090668715880719755862118611910504517411877325663327382275081719175405355478217593357959082658416334550793581368702940807510050067324477863771083298562291247389195817645177719295423270237472084819695982459001922219915224058741833179773113086123062556841877168128535203020515515884172395470425653836651420491478078521498470502057565813752803261046047438368132133582558379717160016464058601966595485808534122429942536044824404974630356183526949241716476300904453899070,"Alpha":20134327893367906186848271747912040110633235155763756608962289665503800402443988610726562974659748340392676514491380028407112376655469504552238349712061211717272326970870137348022169591735942483477878239273386567217277531623360047075339813316023218409990359740980244373133523198267179187714619353413025748035317451421076915031289010895281684327410514275604062451792248129547636609921534494143068354633589312854471928693183148023467082056846965124395590232761913356768140701213970358727760835554935901732479642986466580178078914698960641458765669439291483820484660952058410890249589994714934783196689876305102317892128,"Beta":4769104749502215160103528276907405901039701274645558463841176399426766953251453276997585888336056667058003742560066962203889266160238261104780750185678792016783899685896820470597839801834700997782130686915660425482853175234790494909107857618155084349333754580989593384733739124609723930512465938052260992180099202081026797373928344195857383729859098895075217181612716914446473920221615683752726822588525504221927157806098347431696468687828158956040124186182719538835556368212535020393869358028833163489204691904642226112768693413875158920066595197595224501972965758170532687753505910207190061088883357744579014092752,"P":87263040677642185744670221243368593343731356313572068663794955417522100633736230381991931275537243144757969880827016784466391195604029198799418957687715105703397011312540469603691751275183038739578806835559866535463908060918431135351255483056546683157397967784222215986121160376647847984298442187783135789719,"Q":70157356268570340391167588566652484404699125816686111100335599384724972909645683598894591557109079629672842190893094895224516312192231658553266337679800264517057353212078639884592942505339090130936541285731509111487345601972797758934834667946183637561047841930220368831942721386784968033749455410522766959523,"Xi":16087305610084587677561099384215137857274146882580896345420805013663877079278,"ShareID":57484939971914870596598028213478494578965713220443315190897899253201796287887,"Ks":[57484939971914870596598028213478494578965713220443315190897899253201796287887,57484939971914870596598028213478494578965713220443315190897899253201796287888,57484939971914870596598028213478494578965713220443315190897899253201796287889,57484939971914870596598028213478494578965713220443315190897899253201796287890,57484939971914870596598028213478494578965713220443315190897899253201796287891],"NTildej":[24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489],"H1j":[22231450562334471973618961742797616763434877603759536990055429171943655580664439279419958610772888014456353798981020361149135639525217821205425121486845662180390893935912842304490739461795526425936110185882557879383453966537438512163687673804582033522868345148763295767567221643994073486758870040420796087598143821022690141049410630612722219545247476715172769522813550748788268380178598324837703471829676064678228829702767153912677237945521290063086959482869616602461506402904230610340087208669128408849755792873299578530538374647998629096468609296430016568706541070523464581186829665248448703993586477544553956034821,243564909304646187826183888297681169720877985015680269905983587714837096845390274012688472193406961678810875572537040473860157456926888979142985458669283794727393513439677026887752875758121486989558765604530238677274335131006816351104449995127915498200667761930946464604512161169974158365984447829972674720289063485244230614033492725856247882775589351836570149368319732677864210781190313457540915101720950915966638194939967976938527849567733018974247540951843584867318260634080191424253740128944404737384952924071557119336733983982474112706274716188090946825451340811018400408030512011856140888590383225075124298818,18289002154283623311976266698431211498293734784963868427394245636767119021572249187048386604056252337381471327681265497325630945571777201104688073443965462590425611949197022064581120380987118857747827311731386272136444254806283427519187025413729275683680827267179424974147706698036663953657222392436057744578237859837487234202441250423837052403698219490017791306859855036403233739503134816788149299872176635574289715300073763346350018904256627259358139111177721613066257195741789726100240844475561781279728184036625367665746351018458939770769998766661245582115890818346211382937397604593813004153808612966185967427589,3608707151290460120200313410110317938146529777445481958869507370584267620919874484498244059048971126154641633379388869358167189533743653131477952093156726329245547726549260047498848971213721020937708746935830987729499111818281464816773948822560383145213156864544997896853240503134201367807396994374797160786219742083391049914579858286609731831548186420615207770200989603116469207097383368660658672246192732776358994961035507100437260197407890754435552914690505390593714278050100573867221837896240388297823476836158838968128580054882100677023446344292677326241593066945113747271107113730288470944437688095858200689177,12049772947335122078839454143136842763336714101294350398638263569288276853287186329465277851416773957299235990197580844230822666028936140143158506598954385615569304988062231966466995517907818981933532581402108322189469049381687034219914611020056307456777330494879335754282280016952296774821827594641493838211623624403007367892758601757526070117498103294189971647340450961879076110345922273827329860215671698078617127492413410616612764048779260754599752021616091100432084751555947767285558977881966000809888374655420457219878303172776117557068286461912967518896658743903722358978614824894388859733298934112534154960163],"H2j":[4903195124758783101014195122857885149885108217839819693509468695262427930011900534897220638698974555118369032111074317283371179147198752666772379003701090668715880719755862118611910504517411877325663327382275081719175405355478217593357959082658416334550793581368702940807510050067324477863771083298562291247389195817645177719295423270237472084819695982459001922219915224058741833179773113086123062556841877168128535203020515515884172395470425653836651420491478078521498470502057565813752803261046047438368132133582558379717160016464058601966595485808534122429942536044824404974630356183526949241716476300904453899070,21084886300862505519216367534751919606519594534830658834308002106197683557152978825903624943032297892958317007940831859981871637978913521722088866608196806790988827738157631713857585789132787909569397782677707811662378654174894297343707243607674741204960879391529329411571838044744539466606197565827388072300955320748584869517526540741833860373507412808882961431994962818777141128939901328026075426821040060992072921151932259146227574651731243971634621833545502778720935214861538852574332847645265501451223714089304220802411255269458501696223193092894948851858176596731579177703217340349071048197445150144891298785644,3007783261672980154491744327172997063138589503217753237687559765359177705434774684467861158985361752197735046298475212393949782937608233697218483261367228341578817363129536706256568426815050879419779726563535194250271016345451700683851334863679243336379812576029824122529475518166131290103671591777002124370053711823786959648713805164891735589917136333353705894381517072851044807507028794822247821394176071409967951453887359512551495667063699315624550623628593537905180159275720797402283341621516945427935141443129218113056015993442971497566471595042915046681883002609204821645644938881151616286926712871468864117845,4016822118839092488553776325766595497662837615157606725450869716413592115974012200295269098332482594080853193926753081402606478539310846527374791196257921121362982097689906959098763225966615088837914518556140124054135024117351548727208441888363811484027672142011153118521261756963060549756747016003518897078218669473635373512171106475319991327017205242968685946699808300618760086895295680043693147169773060090561526469192834375280298856575716124508724793645162361229895678890566826340776698163109353537588108903562084797768648888247062565564603088847683798696451886449802810475519018585474518314627077924533059654802,10535138036525962541398812617306958727306013457601320581308737461309299906691317691515916590339505543285315839851378590807111761017323948751485295437227423782051947820658990148190496027422064397590104159315550564612075136524850927319989040698989405812675023978970954916175315018516257846773336511822776043355914179231618369121019891776969392225087688323016859389297066526616464508598591140509516613394191708390957155686309476748859459390338867679846538888803696297674236171398143515079259057215530519688470207018485879274779380503038253404816439176548437604833126690433454291280029508847048812295847509711050229626884],"BigXj":[{"Curve":"secp256k1","Coords":[107835648724779949798808640837827953945816038786532991396734013925392112360222,111356957611616249622396087208812686735392078462911685737986672070502845300027]},{"Curve":"secp256k1","Coords":[101799429129399946712041928379464497916746083969766093060270737364302888604041,23666070898593487758158635604566044778188015356404389255931507506014455903839]},{"Curve":"secp256k1","Coords":[33621518412977179855230181863510046030105962945340821640863059880740258338589,56484044118560761934429329424058122069724129472112256667718154435273085775496]},{"Curve":"secp256k1","Coords":[38072094342526463674028902246753899069434959052326768776660942160541487619985,94706193766123352043331837317359268395870178692988172914401092257882385090624]},{"Curve":"secp256k1","Coords":[26472828124593202764717669281084254145728114975717896354180477989005181650525,14515424185278663327566869905852177050824670586129973820595918189269016785181]}],"PaillierPKs":[{"N":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633},{"N":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541},{"N":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797},{"N":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861},{"N":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489}],"ECDSAPub":{"Curve":"secp256k1","Coords":[79493525990032375682542969979618533998789989364559036285904621150911797629480,36018009044469152286863753693366264314070719680968472490450927755593871021822]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_1.json b/test/_ecdsa_fixtures/keygen_data_1.json deleted file mode 100644 index b4c9c8fe..00000000 --- a/test/_ecdsa_fixtures/keygen_data_1.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,"LambdaN":11699139673635926902889579884085398750869468248622554639934332936159818227678296638590376056695724318253204448870781090137923983744648608965723612493227692041744927684020638856349501451412592114313607598638079531623978349863497048861174830935412009828830501850614497542272227729077976237781377730690405572192889573239961768201617291815968334309618106950336812899588925712395686431438216748459597773786316876596561177634920114095897603060384325741921616105101343398098160356951617134353672649669696962813278624282061255921004103251571254000910588314893382298901603944384856841053510396866840212528030093373141861380486,"PhiN":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144385779146479923536403234583631936668619236213900673625799177851424791372862876433496919195547572633753193122355269840228191795206120768651483843232210202686796196320713903234268707345299339393925626557248564122511842008206503142508001821176629786764597803207888769713682107020793733680425056060186746283722760972},"NTildei":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,"H1i":243564909304646187826183888297681169720877985015680269905983587714837096845390274012688472193406961678810875572537040473860157456926888979142985458669283794727393513439677026887752875758121486989558765604530238677274335131006816351104449995127915498200667761930946464604512161169974158365984447829972674720289063485244230614033492725856247882775589351836570149368319732677864210781190313457540915101720950915966638194939967976938527849567733018974247540951843584867318260634080191424253740128944404737384952924071557119336733983982474112706274716188090946825451340811018400408030512011856140888590383225075124298818,"H2i":21084886300862505519216367534751919606519594534830658834308002106197683557152978825903624943032297892958317007940831859981871637978913521722088866608196806790988827738157631713857585789132787909569397782677707811662378654174894297343707243607674741204960879391529329411571838044744539466606197565827388072300955320748584869517526540741833860373507412808882961431994962818777141128939901328026075426821040060992072921151932259146227574651731243971634621833545502778720935214861538852574332847645265501451223714089304220802411255269458501696223193092894948851858176596731579177703217340349071048197445150144891298785644,"Alpha":4673655074940613680289197904827423419737773677185517635437556483988766502167490864236487991558974438544556887373656742671939417323769864454508392577347952805931226146338163765464788150858722826831024173122264504875676251282167101479079213828580986575974110619893073436551863207276506215824667685069941093315230027945394560713056392061101480778848843752867052248509675213237205457352303010045645908090661429930919930135358344947856951261847845956435686050974151318318372033013312096495066544402770015696043905342231426171500848447458266781578082476376705355056625538459978278297560191097053578855596306846471602841101,"Beta":12801524292818443564892133351773256678641314143044588193329593217098426460207596819811072199922006310012210719685795990085744393066228361438475411612013834538009514722193812758077965563931726088123202795041550644374333580833243856761824587306357742639716124995075398386926379205726189760204236639774032476934313965678193463611415700936943564877998804308064402684837682601161144001201165388312680255232150509931980664241230922509859908953678383077498574764798006791565642170402066158041734158623469912092128973417528714787865366455094663456048763721891104619278446700629242645604353265832654767622700997979739188904,"P":69659493559662389686966171534557556111304365561039371584056683350552475298788220522685051347676628378337665007798636581868972242815275782968366029883515523021117196309659828357408949750617050465363295601684811785260481845180357609670940811817025913548256427310825230964895875036997655554953834768660828380053,"Q":83973763487210656373631203970443214248028099985809339909881648341264752642168124656731238843352234599190251196671690586691187184112930154347731746092584696579580223828810060013044911582205618143450673787371033617115488920494720030781060480426859662191660199549688621543358112451121014485454030558301933866231,"Xi":7440248876316700627456490931034065615692046009714080105785406552022482731206,"ShareID":57484939971914870596598028213478494578965713220443315190897899253201796287888,"Ks":[57484939971914870596598028213478494578965713220443315190897899253201796287887,57484939971914870596598028213478494578965713220443315190897899253201796287888,57484939971914870596598028213478494578965713220443315190897899253201796287889,57484939971914870596598028213478494578965713220443315190897899253201796287890,57484939971914870596598028213478494578965713220443315190897899253201796287891],"NTildej":[24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489],"H1j":[22231450562334471973618961742797616763434877603759536990055429171943655580664439279419958610772888014456353798981020361149135639525217821205425121486845662180390893935912842304490739461795526425936110185882557879383453966537438512163687673804582033522868345148763295767567221643994073486758870040420796087598143821022690141049410630612722219545247476715172769522813550748788268380178598324837703471829676064678228829702767153912677237945521290063086959482869616602461506402904230610340087208669128408849755792873299578530538374647998629096468609296430016568706541070523464581186829665248448703993586477544553956034821,243564909304646187826183888297681169720877985015680269905983587714837096845390274012688472193406961678810875572537040473860157456926888979142985458669283794727393513439677026887752875758121486989558765604530238677274335131006816351104449995127915498200667761930946464604512161169974158365984447829972674720289063485244230614033492725856247882775589351836570149368319732677864210781190313457540915101720950915966638194939967976938527849567733018974247540951843584867318260634080191424253740128944404737384952924071557119336733983982474112706274716188090946825451340811018400408030512011856140888590383225075124298818,18289002154283623311976266698431211498293734784963868427394245636767119021572249187048386604056252337381471327681265497325630945571777201104688073443965462590425611949197022064581120380987118857747827311731386272136444254806283427519187025413729275683680827267179424974147706698036663953657222392436057744578237859837487234202441250423837052403698219490017791306859855036403233739503134816788149299872176635574289715300073763346350018904256627259358139111177721613066257195741789726100240844475561781279728184036625367665746351018458939770769998766661245582115890818346211382937397604593813004153808612966185967427589,3608707151290460120200313410110317938146529777445481958869507370584267620919874484498244059048971126154641633379388869358167189533743653131477952093156726329245547726549260047498848971213721020937708746935830987729499111818281464816773948822560383145213156864544997896853240503134201367807396994374797160786219742083391049914579858286609731831548186420615207770200989603116469207097383368660658672246192732776358994961035507100437260197407890754435552914690505390593714278050100573867221837896240388297823476836158838968128580054882100677023446344292677326241593066945113747271107113730288470944437688095858200689177,12049772947335122078839454143136842763336714101294350398638263569288276853287186329465277851416773957299235990197580844230822666028936140143158506598954385615569304988062231966466995517907818981933532581402108322189469049381687034219914611020056307456777330494879335754282280016952296774821827594641493838211623624403007367892758601757526070117498103294189971647340450961879076110345922273827329860215671698078617127492413410616612764048779260754599752021616091100432084751555947767285558977881966000809888374655420457219878303172776117557068286461912967518896658743903722358978614824894388859733298934112534154960163],"H2j":[4903195124758783101014195122857885149885108217839819693509468695262427930011900534897220638698974555118369032111074317283371179147198752666772379003701090668715880719755862118611910504517411877325663327382275081719175405355478217593357959082658416334550793581368702940807510050067324477863771083298562291247389195817645177719295423270237472084819695982459001922219915224058741833179773113086123062556841877168128535203020515515884172395470425653836651420491478078521498470502057565813752803261046047438368132133582558379717160016464058601966595485808534122429942536044824404974630356183526949241716476300904453899070,21084886300862505519216367534751919606519594534830658834308002106197683557152978825903624943032297892958317007940831859981871637978913521722088866608196806790988827738157631713857585789132787909569397782677707811662378654174894297343707243607674741204960879391529329411571838044744539466606197565827388072300955320748584869517526540741833860373507412808882961431994962818777141128939901328026075426821040060992072921151932259146227574651731243971634621833545502778720935214861538852574332847645265501451223714089304220802411255269458501696223193092894948851858176596731579177703217340349071048197445150144891298785644,3007783261672980154491744327172997063138589503217753237687559765359177705434774684467861158985361752197735046298475212393949782937608233697218483261367228341578817363129536706256568426815050879419779726563535194250271016345451700683851334863679243336379812576029824122529475518166131290103671591777002124370053711823786959648713805164891735589917136333353705894381517072851044807507028794822247821394176071409967951453887359512551495667063699315624550623628593537905180159275720797402283341621516945427935141443129218113056015993442971497566471595042915046681883002609204821645644938881151616286926712871468864117845,4016822118839092488553776325766595497662837615157606725450869716413592115974012200295269098332482594080853193926753081402606478539310846527374791196257921121362982097689906959098763225966615088837914518556140124054135024117351548727208441888363811484027672142011153118521261756963060549756747016003518897078218669473635373512171106475319991327017205242968685946699808300618760086895295680043693147169773060090561526469192834375280298856575716124508724793645162361229895678890566826340776698163109353537588108903562084797768648888247062565564603088847683798696451886449802810475519018585474518314627077924533059654802,10535138036525962541398812617306958727306013457601320581308737461309299906691317691515916590339505543285315839851378590807111761017323948751485295437227423782051947820658990148190496027422064397590104159315550564612075136524850927319989040698989405812675023978970954916175315018516257846773336511822776043355914179231618369121019891776969392225087688323016859389297066526616464508598591140509516613394191708390957155686309476748859459390338867679846538888803696297674236171398143515079259057215530519688470207018485879274779380503038253404816439176548437604833126690433454291280029508847048812295847509711050229626884],"BigXj":[{"Curve":"secp256k1","Coords":[107835648724779949798808640837827953945816038786532991396734013925392112360222,111356957611616249622396087208812686735392078462911685737986672070502845300027]},{"Curve":"secp256k1","Coords":[101799429129399946712041928379464497916746083969766093060270737364302888604041,23666070898593487758158635604566044778188015356404389255931507506014455903839]},{"Curve":"secp256k1","Coords":[33621518412977179855230181863510046030105962945340821640863059880740258338589,56484044118560761934429329424058122069724129472112256667718154435273085775496]},{"Curve":"secp256k1","Coords":[38072094342526463674028902246753899069434959052326768776660942160541487619985,94706193766123352043331837317359268395870178692988172914401092257882385090624]},{"Curve":"secp256k1","Coords":[26472828124593202764717669281084254145728114975717896354180477989005181650525,14515424185278663327566869905852177050824670586129973820595918189269016785181]}],"PaillierPKs":[{"N":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633},{"N":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541},{"N":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797},{"N":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861},{"N":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489}],"ECDSAPub":{"Curve":"secp256k1","Coords":[79493525990032375682542969979618533998789989364559036285904621150911797629480,36018009044469152286863753693366264314070719680968472490450927755593871021822]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_2.json b/test/_ecdsa_fixtures/keygen_data_2.json deleted file mode 100644 index d86c73c1..00000000 --- a/test/_ecdsa_fixtures/keygen_data_2.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,"LambdaN":13280900778994969406681544535442281997449261211362954616688789961142825039240001392144050284758013002936434138024123280648820804746016631210608906329806167486447076382048468707489094262054629796689939533442547077488623133427702090344898544063467776169502777327274511759225687485050179821576268147892730240041830425149589888268175095251032154486638096289903611474182804306508891328224873976115344291452104360279658912251686425083597765024711908267161169522661542775763586619543856513579861734343277267566343817631518298311718045791524379454686704864634016970918862486260840515949256666037686478357726837318220517066798,"PhiN":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083660850299179776536350190502064308973276192579807222948365608613017782656449747952230688582904208720559317824503372850167195530049423816534322339045323085551527173239087713027159723468686554535132687635263036596623436091583048758909373409729268033941837724972521681031898513332075372956715453674636441034133596},"NTildei":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,"H1i":18289002154283623311976266698431211498293734784963868427394245636767119021572249187048386604056252337381471327681265497325630945571777201104688073443965462590425611949197022064581120380987118857747827311731386272136444254806283427519187025413729275683680827267179424974147706698036663953657222392436057744578237859837487234202441250423837052403698219490017791306859855036403233739503134816788149299872176635574289715300073763346350018904256627259358139111177721613066257195741789726100240844475561781279728184036625367665746351018458939770769998766661245582115890818346211382937397604593813004153808612966185967427589,"H2i":3007783261672980154491744327172997063138589503217753237687559765359177705434774684467861158985361752197735046298475212393949782937608233697218483261367228341578817363129536706256568426815050879419779726563535194250271016345451700683851334863679243336379812576029824122529475518166131290103671591777002124370053711823786959648713805164891735589917136333353705894381517072851044807507028794822247821394176071409967951453887359512551495667063699315624550623628593537905180159275720797402283341621516945427935141443129218113056015993442971497566471595042915046681883002609204821645644938881151616286926712871468864117845,"Alpha":6359038170843016267272670298900517981275890434029877435839834298582631906330852305325647919065729927083059945242941171108063381884878596981325705925901540290448222518799193159686611402977408092854543719782550019930413992793802137589259047658962103732382313219179545939349713542872395592880464242651499206792364115392724922087540541021682479030855893580754352626642835422264016779068401511093984830329635382991630195558407726706321670136828582571470575791945498301484180458903162568362774948612290668513330346242243391702809053425156690135128054218747449140958752862188321966323573086082091153188034013351311382303486,"Beta":6118176388772590759390838795288441615774284768514772010300333424431003051651667356238328699555667601307630023760587599919253921815981409011415816401967002786008153650788027042435672965082772047594584145012262321401410204465017539003987913382203233856521096437454194698674087847075656190996095012686553898592102217698033192359107171044773433235219206875395661380766572713026199074037485067850136148963044037200493500791840671685019205262300404053729724537979876139310953082758851736962975545188156755791534474940696012045362551405967999973585073958170290585093217477249260550232888096354189290974640913112743210588762,"P":75732768670668108405624252453165596348703484192308065971566237629360060064447957954477894285013069062898285487530025489794550318431372718327550373520424446307212947852811329866617962836291723234414130004996765607894724632803358842156541781925390003562795930893180894110384176653704539589034245756166427443249,"Q":87682657138473043799246182563658831111329013484239094734018089650321671606567116098210276990890167779320071531950899231835194605053247506351626777544825896604053226514237473972478384621624717130833348208672793978667600013725403660784067837759393039030830306593807903209354875473094154040494666186290669297351,"Xi":64917705738580334038727029061507814489989668801134921781559417532335564723781,"ShareID":57484939971914870596598028213478494578965713220443315190897899253201796287889,"Ks":[57484939971914870596598028213478494578965713220443315190897899253201796287887,57484939971914870596598028213478494578965713220443315190897899253201796287888,57484939971914870596598028213478494578965713220443315190897899253201796287889,57484939971914870596598028213478494578965713220443315190897899253201796287890,57484939971914870596598028213478494578965713220443315190897899253201796287891],"NTildej":[24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489],"H1j":[22231450562334471973618961742797616763434877603759536990055429171943655580664439279419958610772888014456353798981020361149135639525217821205425121486845662180390893935912842304490739461795526425936110185882557879383453966537438512163687673804582033522868345148763295767567221643994073486758870040420796087598143821022690141049410630612722219545247476715172769522813550748788268380178598324837703471829676064678228829702767153912677237945521290063086959482869616602461506402904230610340087208669128408849755792873299578530538374647998629096468609296430016568706541070523464581186829665248448703993586477544553956034821,243564909304646187826183888297681169720877985015680269905983587714837096845390274012688472193406961678810875572537040473860157456926888979142985458669283794727393513439677026887752875758121486989558765604530238677274335131006816351104449995127915498200667761930946464604512161169974158365984447829972674720289063485244230614033492725856247882775589351836570149368319732677864210781190313457540915101720950915966638194939967976938527849567733018974247540951843584867318260634080191424253740128944404737384952924071557119336733983982474112706274716188090946825451340811018400408030512011856140888590383225075124298818,18289002154283623311976266698431211498293734784963868427394245636767119021572249187048386604056252337381471327681265497325630945571777201104688073443965462590425611949197022064581120380987118857747827311731386272136444254806283427519187025413729275683680827267179424974147706698036663953657222392436057744578237859837487234202441250423837052403698219490017791306859855036403233739503134816788149299872176635574289715300073763346350018904256627259358139111177721613066257195741789726100240844475561781279728184036625367665746351018458939770769998766661245582115890818346211382937397604593813004153808612966185967427589,3608707151290460120200313410110317938146529777445481958869507370584267620919874484498244059048971126154641633379388869358167189533743653131477952093156726329245547726549260047498848971213721020937708746935830987729499111818281464816773948822560383145213156864544997896853240503134201367807396994374797160786219742083391049914579858286609731831548186420615207770200989603116469207097383368660658672246192732776358994961035507100437260197407890754435552914690505390593714278050100573867221837896240388297823476836158838968128580054882100677023446344292677326241593066945113747271107113730288470944437688095858200689177,12049772947335122078839454143136842763336714101294350398638263569288276853287186329465277851416773957299235990197580844230822666028936140143158506598954385615569304988062231966466995517907818981933532581402108322189469049381687034219914611020056307456777330494879335754282280016952296774821827594641493838211623624403007367892758601757526070117498103294189971647340450961879076110345922273827329860215671698078617127492413410616612764048779260754599752021616091100432084751555947767285558977881966000809888374655420457219878303172776117557068286461912967518896658743903722358978614824894388859733298934112534154960163],"H2j":[4903195124758783101014195122857885149885108217839819693509468695262427930011900534897220638698974555118369032111074317283371179147198752666772379003701090668715880719755862118611910504517411877325663327382275081719175405355478217593357959082658416334550793581368702940807510050067324477863771083298562291247389195817645177719295423270237472084819695982459001922219915224058741833179773113086123062556841877168128535203020515515884172395470425653836651420491478078521498470502057565813752803261046047438368132133582558379717160016464058601966595485808534122429942536044824404974630356183526949241716476300904453899070,21084886300862505519216367534751919606519594534830658834308002106197683557152978825903624943032297892958317007940831859981871637978913521722088866608196806790988827738157631713857585789132787909569397782677707811662378654174894297343707243607674741204960879391529329411571838044744539466606197565827388072300955320748584869517526540741833860373507412808882961431994962818777141128939901328026075426821040060992072921151932259146227574651731243971634621833545502778720935214861538852574332847645265501451223714089304220802411255269458501696223193092894948851858176596731579177703217340349071048197445150144891298785644,3007783261672980154491744327172997063138589503217753237687559765359177705434774684467861158985361752197735046298475212393949782937608233697218483261367228341578817363129536706256568426815050879419779726563535194250271016345451700683851334863679243336379812576029824122529475518166131290103671591777002124370053711823786959648713805164891735589917136333353705894381517072851044807507028794822247821394176071409967951453887359512551495667063699315624550623628593537905180159275720797402283341621516945427935141443129218113056015993442971497566471595042915046681883002609204821645644938881151616286926712871468864117845,4016822118839092488553776325766595497662837615157606725450869716413592115974012200295269098332482594080853193926753081402606478539310846527374791196257921121362982097689906959098763225966615088837914518556140124054135024117351548727208441888363811484027672142011153118521261756963060549756747016003518897078218669473635373512171106475319991327017205242968685946699808300618760086895295680043693147169773060090561526469192834375280298856575716124508724793645162361229895678890566826340776698163109353537588108903562084797768648888247062565564603088847683798696451886449802810475519018585474518314627077924533059654802,10535138036525962541398812617306958727306013457601320581308737461309299906691317691515916590339505543285315839851378590807111761017323948751485295437227423782051947820658990148190496027422064397590104159315550564612075136524850927319989040698989405812675023978970954916175315018516257846773336511822776043355914179231618369121019891776969392225087688323016859389297066526616464508598591140509516613394191708390957155686309476748859459390338867679846538888803696297674236171398143515079259057215530519688470207018485879274779380503038253404816439176548437604833126690433454291280029508847048812295847509711050229626884],"BigXj":[{"Curve":"secp256k1","Coords":[107835648724779949798808640837827953945816038786532991396734013925392112360222,111356957611616249622396087208812686735392078462911685737986672070502845300027]},{"Curve":"secp256k1","Coords":[101799429129399946712041928379464497916746083969766093060270737364302888604041,23666070898593487758158635604566044778188015356404389255931507506014455903839]},{"Curve":"secp256k1","Coords":[33621518412977179855230181863510046030105962945340821640863059880740258338589,56484044118560761934429329424058122069724129472112256667718154435273085775496]},{"Curve":"secp256k1","Coords":[38072094342526463674028902246753899069434959052326768776660942160541487619985,94706193766123352043331837317359268395870178692988172914401092257882385090624]},{"Curve":"secp256k1","Coords":[26472828124593202764717669281084254145728114975717896354180477989005181650525,14515424185278663327566869905852177050824670586129973820595918189269016785181]}],"PaillierPKs":[{"N":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633},{"N":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541},{"N":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797},{"N":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861},{"N":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489}],"ECDSAPub":{"Curve":"secp256k1","Coords":[79493525990032375682542969979618533998789989364559036285904621150911797629480,36018009044469152286863753693366264314070719680968472490450927755593871021822]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_3.json b/test/_ecdsa_fixtures/keygen_data_3.json deleted file mode 100644 index aa052a52..00000000 --- a/test/_ecdsa_fixtures/keygen_data_3.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,"LambdaN":10396634245109342387256346800676139222514161344721601040532456775308701333151684773004659495054988275845445558348923310556618130164707824849363341674077214655262976434354033840087303825565618907194631324834224352219732523702093004077376960506675034278486281695295026364491584017231722187974175395230348032800773156172640978543691208001624290793045373744682425011687632359151347894409051401720265005342811152921465965666980398067031765284775912633010848503432459826093486837510311487351649662726043317917753941752152225675808553321802462270932481545525914906412749354373014764035557170191019066879773786043672882619462,"PhiN":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601546312345281957087382416003248581586090747489364850023375264718302695788818102803440530010685622305842931931333960796134063530569551825266021697006864919652186973675020622974703299325452086635835507883504304451351617106643604924541864963091051829812825498708746029528071114340382038133759547572087345765238924},"NTildei":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,"H1i":3608707151290460120200313410110317938146529777445481958869507370584267620919874484498244059048971126154641633379388869358167189533743653131477952093156726329245547726549260047498848971213721020937708746935830987729499111818281464816773948822560383145213156864544997896853240503134201367807396994374797160786219742083391049914579858286609731831548186420615207770200989603116469207097383368660658672246192732776358994961035507100437260197407890754435552914690505390593714278050100573867221837896240388297823476836158838968128580054882100677023446344292677326241593066945113747271107113730288470944437688095858200689177,"H2i":4016822118839092488553776325766595497662837615157606725450869716413592115974012200295269098332482594080853193926753081402606478539310846527374791196257921121362982097689906959098763225966615088837914518556140124054135024117351548727208441888363811484027672142011153118521261756963060549756747016003518897078218669473635373512171106475319991327017205242968685946699808300618760086895295680043693147169773060090561526469192834375280298856575716124508724793645162361229895678890566826340776698163109353537588108903562084797768648888247062565564603088847683798696451886449802810475519018585474518314627077924533059654802,"Alpha":3174277577609098411382832939130001125695873431249341546715896952024830773447154457654849405811708263304784520675512157005461866400869912508872515961071967228827313288382700222351386327674026913573574187419155166099409970009611810510832014376496891429078090602758605828177741616777652244270010873801677951181442053506384221339724623330459669274498439649678674546464092039501575830131866194971202812462185994529471407186329529835104957197524461361735436414735649587868328477772264850910184837595548563312422310365457245057849850511461348439914435721731486603869924771624437029844557189476270458426917400405903041195272,"Beta":4083885739404704324307653490227793326481330180756644151904305695515656717433472849974985801383356623603679458726280411418245060708694310533383452092706144501998709986610805811008220789426852264902432865453050379418874291981918200974194899438110649470264987294873167352110492106489514073391330661456273107511644456587899614191066007379024655242635159830630125908411841491099744835889397970222260507975410094662842401940217852972451775090936482990687496697343189301789925607198512586442037224862090913244244310059932864979286458346720685806980174000031678665774811293621249078062386067645178119999408563471177351132816,"P":73724539956035188951643923371096202909846769701628135656723292322387108309309131322820457605897555848614277642033372230427964146356841288301499404911328565284569272225247129975513151910287392925538600320207010822094476047260912889776142956587834744464973280805747717207920989471451384915336225555487497470129,"Q":70509997426292926446136051589185542064639407755934064435093446955599168571518039691448436734834533853091954003033900518514040226721802430612748288594695723940599284788683324095440390966510201242432569673425677355973462368879614406025509088970147533083259945830900180517756241755060509487012728387562048984339,"Xi":72727586959559292487801728766948476627329450977768516990137674813084961562666,"ShareID":57484939971914870596598028213478494578965713220443315190897899253201796287890,"Ks":[57484939971914870596598028213478494578965713220443315190897899253201796287887,57484939971914870596598028213478494578965713220443315190897899253201796287888,57484939971914870596598028213478494578965713220443315190897899253201796287889,57484939971914870596598028213478494578965713220443315190897899253201796287890,57484939971914870596598028213478494578965713220443315190897899253201796287891],"NTildej":[24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489],"H1j":[22231450562334471973618961742797616763434877603759536990055429171943655580664439279419958610772888014456353798981020361149135639525217821205425121486845662180390893935912842304490739461795526425936110185882557879383453966537438512163687673804582033522868345148763295767567221643994073486758870040420796087598143821022690141049410630612722219545247476715172769522813550748788268380178598324837703471829676064678228829702767153912677237945521290063086959482869616602461506402904230610340087208669128408849755792873299578530538374647998629096468609296430016568706541070523464581186829665248448703993586477544553956034821,243564909304646187826183888297681169720877985015680269905983587714837096845390274012688472193406961678810875572537040473860157456926888979142985458669283794727393513439677026887752875758121486989558765604530238677274335131006816351104449995127915498200667761930946464604512161169974158365984447829972674720289063485244230614033492725856247882775589351836570149368319732677864210781190313457540915101720950915966638194939967976938527849567733018974247540951843584867318260634080191424253740128944404737384952924071557119336733983982474112706274716188090946825451340811018400408030512011856140888590383225075124298818,18289002154283623311976266698431211498293734784963868427394245636767119021572249187048386604056252337381471327681265497325630945571777201104688073443965462590425611949197022064581120380987118857747827311731386272136444254806283427519187025413729275683680827267179424974147706698036663953657222392436057744578237859837487234202441250423837052403698219490017791306859855036403233739503134816788149299872176635574289715300073763346350018904256627259358139111177721613066257195741789726100240844475561781279728184036625367665746351018458939770769998766661245582115890818346211382937397604593813004153808612966185967427589,3608707151290460120200313410110317938146529777445481958869507370584267620919874484498244059048971126154641633379388869358167189533743653131477952093156726329245547726549260047498848971213721020937708746935830987729499111818281464816773948822560383145213156864544997896853240503134201367807396994374797160786219742083391049914579858286609731831548186420615207770200989603116469207097383368660658672246192732776358994961035507100437260197407890754435552914690505390593714278050100573867221837896240388297823476836158838968128580054882100677023446344292677326241593066945113747271107113730288470944437688095858200689177,12049772947335122078839454143136842763336714101294350398638263569288276853287186329465277851416773957299235990197580844230822666028936140143158506598954385615569304988062231966466995517907818981933532581402108322189469049381687034219914611020056307456777330494879335754282280016952296774821827594641493838211623624403007367892758601757526070117498103294189971647340450961879076110345922273827329860215671698078617127492413410616612764048779260754599752021616091100432084751555947767285558977881966000809888374655420457219878303172776117557068286461912967518896658743903722358978614824894388859733298934112534154960163],"H2j":[4903195124758783101014195122857885149885108217839819693509468695262427930011900534897220638698974555118369032111074317283371179147198752666772379003701090668715880719755862118611910504517411877325663327382275081719175405355478217593357959082658416334550793581368702940807510050067324477863771083298562291247389195817645177719295423270237472084819695982459001922219915224058741833179773113086123062556841877168128535203020515515884172395470425653836651420491478078521498470502057565813752803261046047438368132133582558379717160016464058601966595485808534122429942536044824404974630356183526949241716476300904453899070,21084886300862505519216367534751919606519594534830658834308002106197683557152978825903624943032297892958317007940831859981871637978913521722088866608196806790988827738157631713857585789132787909569397782677707811662378654174894297343707243607674741204960879391529329411571838044744539466606197565827388072300955320748584869517526540741833860373507412808882961431994962818777141128939901328026075426821040060992072921151932259146227574651731243971634621833545502778720935214861538852574332847645265501451223714089304220802411255269458501696223193092894948851858176596731579177703217340349071048197445150144891298785644,3007783261672980154491744327172997063138589503217753237687559765359177705434774684467861158985361752197735046298475212393949782937608233697218483261367228341578817363129536706256568426815050879419779726563535194250271016345451700683851334863679243336379812576029824122529475518166131290103671591777002124370053711823786959648713805164891735589917136333353705894381517072851044807507028794822247821394176071409967951453887359512551495667063699315624550623628593537905180159275720797402283341621516945427935141443129218113056015993442971497566471595042915046681883002609204821645644938881151616286926712871468864117845,4016822118839092488553776325766595497662837615157606725450869716413592115974012200295269098332482594080853193926753081402606478539310846527374791196257921121362982097689906959098763225966615088837914518556140124054135024117351548727208441888363811484027672142011153118521261756963060549756747016003518897078218669473635373512171106475319991327017205242968685946699808300618760086895295680043693147169773060090561526469192834375280298856575716124508724793645162361229895678890566826340776698163109353537588108903562084797768648888247062565564603088847683798696451886449802810475519018585474518314627077924533059654802,10535138036525962541398812617306958727306013457601320581308737461309299906691317691515916590339505543285315839851378590807111761017323948751485295437227423782051947820658990148190496027422064397590104159315550564612075136524850927319989040698989405812675023978970954916175315018516257846773336511822776043355914179231618369121019891776969392225087688323016859389297066526616464508598591140509516613394191708390957155686309476748859459390338867679846538888803696297674236171398143515079259057215530519688470207018485879274779380503038253404816439176548437604833126690433454291280029508847048812295847509711050229626884],"BigXj":[{"Curve":"secp256k1","Coords":[107835648724779949798808640837827953945816038786532991396734013925392112360222,111356957611616249622396087208812686735392078462911685737986672070502845300027]},{"Curve":"secp256k1","Coords":[101799429129399946712041928379464497916746083969766093060270737364302888604041,23666070898593487758158635604566044778188015356404389255931507506014455903839]},{"Curve":"secp256k1","Coords":[33621518412977179855230181863510046030105962945340821640863059880740258338589,56484044118560761934429329424058122069724129472112256667718154435273085775496]},{"Curve":"secp256k1","Coords":[38072094342526463674028902246753899069434959052326768776660942160541487619985,94706193766123352043331837317359268395870178692988172914401092257882385090624]},{"Curve":"secp256k1","Coords":[26472828124593202764717669281084254145728114975717896354180477989005181650525,14515424185278663327566869905852177050824670586129973820595918189269016785181]}],"PaillierPKs":[{"N":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633},{"N":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541},{"N":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797},{"N":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861},{"N":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489}],"ECDSAPub":{"Curve":"secp256k1","Coords":[79493525990032375682542969979618533998789989364559036285904621150911797629480,36018009044469152286863753693366264314070719680968472490450927755593871021822]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_4.json b/test/_ecdsa_fixtures/keygen_data_4.json deleted file mode 100644 index 2ecf667c..00000000 --- a/test/_ecdsa_fixtures/keygen_data_4.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489,"LambdaN":13719439580862569660610038270197643594148250239620257975246627970382445701714045403777178190999860327048359159100221665219210037153719439831269585330001059176058825858023318745794896610349675773908701559962023899655128969747466945116739656255886089236240101065165376359834306859518237466988769502567382569212028586612736179719707186756311412158452406339894712668087584252706861079590690206597467882674711850384626913422041140620323816641867809459030198599525915578374510189633908762403473316177499490242387693125094186241311506514336571607995303769250161021190538138328091761274449116573301461734336202584258309065962,"PhiN":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424057173225472359439414373512622824316904812679789425336175168505413722159181380413194935765349423700769253826844082281240647633283735618918060397199051831156749020379267817524806946632354998980484775386250188372482623013028673143215990607538500322042381076276656183522548898233146602923468672405168516618131924},"NTildei":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489,"H1i":12049772947335122078839454143136842763336714101294350398638263569288276853287186329465277851416773957299235990197580844230822666028936140143158506598954385615569304988062231966466995517907818981933532581402108322189469049381687034219914611020056307456777330494879335754282280016952296774821827594641493838211623624403007367892758601757526070117498103294189971647340450961879076110345922273827329860215671698078617127492413410616612764048779260754599752021616091100432084751555947767285558977881966000809888374655420457219878303172776117557068286461912967518896658743903722358978614824894388859733298934112534154960163,"H2i":10535138036525962541398812617306958727306013457601320581308737461309299906691317691515916590339505543285315839851378590807111761017323948751485295437227423782051947820658990148190496027422064397590104159315550564612075136524850927319989040698989405812675023978970954916175315018516257846773336511822776043355914179231618369121019891776969392225087688323016859389297066526616464508598591140509516613394191708390957155686309476748859459390338867679846538888803696297674236171398143515079259057215530519688470207018485879274779380503038253404816439176548437604833126690433454291280029508847048812295847509711050229626884,"Alpha":20085346912084533807594495712273675854997165103045042610094623667676008869674288270698717163302447358661325941442316690977011451450450075528645671412964368819578702753724900108831167389602954082839705628887052828769263400580126437287260153768900805421221861449128267254858509165306865288012087727593118414189371146013169179700362897447155231707279720670801295709224224403307402168195546324614397293059917881088258218419030553858218517002321085755502157779840173086060283347358341497980594604714390533368570781801607282479468659499609952309181815079279845606214905022200410576114500098700387027572641084262408498404128,"Beta":3295112256488003037031454540995334202894730765438353962213305103650495122135218568459731891426646410961627275381097462514502881527264288789351828660675105959651099237728046019773486316232113598753668993864943191079931421936218807963121691506063525227442838816209875179846938360044577611393926855439774464828650534374476012814281415862752821884681894105057152482166634471045907012473348471820383454074521614047150869518670453326248392409046061874783569091789518871648083507447567980354594483022746680413860302095992741739564327692375276914191472283795400075600880615885833262286258345357653402244100970356941335195753,"P":78958733889611813074890847641433295327265853641746665887222903242297355169433897153012296341037905508824904943589242701761200123234885836718808046499764824537238101194955255110927660051895644147918976871628396372671181070348839146106685293578946741314954445291325898230061528569510549567673776969603283878071,"Q":86877276933309365319404018971649525911515254534944223944044586155694456518848824925951306938697890947305710491390796869871375264663215154524700420907289345448330044857660817684826933436120190632481090783371559125634356468908560436340812424788059833007982826823651708140763688110320334593144657419004332060211,"Xi":30869892539253575974680590047356052027711392539614865731520178394270673247861,"ShareID":57484939971914870596598028213478494578965713220443315190897899253201796287891,"Ks":[57484939971914870596598028213478494578965713220443315190897899253201796287887,57484939971914870596598028213478494578965713220443315190897899253201796287888,57484939971914870596598028213478494578965713220443315190897899253201796287889,57484939971914870596598028213478494578965713220443315190897899253201796287890,57484939971914870596598028213478494578965713220443315190897899253201796287891],"NTildej":[24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633,23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541,26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797,20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861,27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489],"H1j":[22231450562334471973618961742797616763434877603759536990055429171943655580664439279419958610772888014456353798981020361149135639525217821205425121486845662180390893935912842304490739461795526425936110185882557879383453966537438512163687673804582033522868345148763295767567221643994073486758870040420796087598143821022690141049410630612722219545247476715172769522813550748788268380178598324837703471829676064678228829702767153912677237945521290063086959482869616602461506402904230610340087208669128408849755792873299578530538374647998629096468609296430016568706541070523464581186829665248448703993586477544553956034821,243564909304646187826183888297681169720877985015680269905983587714837096845390274012688472193406961678810875572537040473860157456926888979142985458669283794727393513439677026887752875758121486989558765604530238677274335131006816351104449995127915498200667761930946464604512161169974158365984447829972674720289063485244230614033492725856247882775589351836570149368319732677864210781190313457540915101720950915966638194939967976938527849567733018974247540951843584867318260634080191424253740128944404737384952924071557119336733983982474112706274716188090946825451340811018400408030512011856140888590383225075124298818,18289002154283623311976266698431211498293734784963868427394245636767119021572249187048386604056252337381471327681265497325630945571777201104688073443965462590425611949197022064581120380987118857747827311731386272136444254806283427519187025413729275683680827267179424974147706698036663953657222392436057744578237859837487234202441250423837052403698219490017791306859855036403233739503134816788149299872176635574289715300073763346350018904256627259358139111177721613066257195741789726100240844475561781279728184036625367665746351018458939770769998766661245582115890818346211382937397604593813004153808612966185967427589,3608707151290460120200313410110317938146529777445481958869507370584267620919874484498244059048971126154641633379388869358167189533743653131477952093156726329245547726549260047498848971213721020937708746935830987729499111818281464816773948822560383145213156864544997896853240503134201367807396994374797160786219742083391049914579858286609731831548186420615207770200989603116469207097383368660658672246192732776358994961035507100437260197407890754435552914690505390593714278050100573867221837896240388297823476836158838968128580054882100677023446344292677326241593066945113747271107113730288470944437688095858200689177,12049772947335122078839454143136842763336714101294350398638263569288276853287186329465277851416773957299235990197580844230822666028936140143158506598954385615569304988062231966466995517907818981933532581402108322189469049381687034219914611020056307456777330494879335754282280016952296774821827594641493838211623624403007367892758601757526070117498103294189971647340450961879076110345922273827329860215671698078617127492413410616612764048779260754599752021616091100432084751555947767285558977881966000809888374655420457219878303172776117557068286461912967518896658743903722358978614824894388859733298934112534154960163],"H2j":[4903195124758783101014195122857885149885108217839819693509468695262427930011900534897220638698974555118369032111074317283371179147198752666772379003701090668715880719755862118611910504517411877325663327382275081719175405355478217593357959082658416334550793581368702940807510050067324477863771083298562291247389195817645177719295423270237472084819695982459001922219915224058741833179773113086123062556841877168128535203020515515884172395470425653836651420491478078521498470502057565813752803261046047438368132133582558379717160016464058601966595485808534122429942536044824404974630356183526949241716476300904453899070,21084886300862505519216367534751919606519594534830658834308002106197683557152978825903624943032297892958317007940831859981871637978913521722088866608196806790988827738157631713857585789132787909569397782677707811662378654174894297343707243607674741204960879391529329411571838044744539466606197565827388072300955320748584869517526540741833860373507412808882961431994962818777141128939901328026075426821040060992072921151932259146227574651731243971634621833545502778720935214861538852574332847645265501451223714089304220802411255269458501696223193092894948851858176596731579177703217340349071048197445150144891298785644,3007783261672980154491744327172997063138589503217753237687559765359177705434774684467861158985361752197735046298475212393949782937608233697218483261367228341578817363129536706256568426815050879419779726563535194250271016345451700683851334863679243336379812576029824122529475518166131290103671591777002124370053711823786959648713805164891735589917136333353705894381517072851044807507028794822247821394176071409967951453887359512551495667063699315624550623628593537905180159275720797402283341621516945427935141443129218113056015993442971497566471595042915046681883002609204821645644938881151616286926712871468864117845,4016822118839092488553776325766595497662837615157606725450869716413592115974012200295269098332482594080853193926753081402606478539310846527374791196257921121362982097689906959098763225966615088837914518556140124054135024117351548727208441888363811484027672142011153118521261756963060549756747016003518897078218669473635373512171106475319991327017205242968685946699808300618760086895295680043693147169773060090561526469192834375280298856575716124508724793645162361229895678890566826340776698163109353537588108903562084797768648888247062565564603088847683798696451886449802810475519018585474518314627077924533059654802,10535138036525962541398812617306958727306013457601320581308737461309299906691317691515916590339505543285315839851378590807111761017323948751485295437227423782051947820658990148190496027422064397590104159315550564612075136524850927319989040698989405812675023978970954916175315018516257846773336511822776043355914179231618369121019891776969392225087688323016859389297066526616464508598591140509516613394191708390957155686309476748859459390338867679846538888803696297674236171398143515079259057215530519688470207018485879274779380503038253404816439176548437604833126690433454291280029508847048812295847509711050229626884],"BigXj":[{"Curve":"secp256k1","Coords":[107835648724779949798808640837827953945816038786532991396734013925392112360222,111356957611616249622396087208812686735392078462911685737986672070502845300027]},{"Curve":"secp256k1","Coords":[101799429129399946712041928379464497916746083969766093060270737364302888604041,23666070898593487758158635604566044778188015356404389255931507506014455903839]},{"Curve":"secp256k1","Coords":[33621518412977179855230181863510046030105962945340821640863059880740258338589,56484044118560761934429329424058122069724129472112256667718154435273085775496]},{"Curve":"secp256k1","Coords":[38072094342526463674028902246753899069434959052326768776660942160541487619985,94706193766123352043331837317359268395870178692988172914401092257882385090624]},{"Curve":"secp256k1","Coords":[26472828124593202764717669281084254145728114975717896354180477989005181650525,14515424185278663327566869905852177050824670586129973820595918189269016785181]}],"PaillierPKs":[{"N":24488576935600354417078476924104022684508061543404510944294553501426757937937976854420112777641372412892375904756456735092199201263563012041527716635973303201248583096788229658395179117290090907763271206971169909169060873089440061039110881634514004138555065779773228992068316447091377272193698220774804774049371288051127174239811674149243219638361036905335478071208209253989775840017019297527877423802306505057527158269513887414220586256255448607117376570387448034242413683351789387065536827968412947753351201500492178780569564194582793952019448040706153660988727612230974968797585746729797407353331964300792255674633},{"N":23398279347271853805779159768170797501738936497245109279868665872319636455356593277180752113391448636506408897741562180275847967489297217931447224986455384083489855368041277712699002902825184228627215197276159063247956699726994097722349661870824019657661003701228995084544455458155952475562755461380811144386086412994017282495355778382946670159954878831767323222165728088175007318758346187278028127954691479148178187678780882528915524974625063358475427762154887235397715554180174045448253022005039262844185187342234202646760148034492663282725179214274535749283041142490741387123528768709917765136875917400209247253541},{"N":26561801557989938813363089070884563994898522422725909233377579922285650078480002784288100569516026005872868276048246561297641609492033262421217812659612334972894152764096937414978188524109259593379879066885094154977246266855404180689797088126935552339005554654549023518451374970100359643152536295785460480083987681150798058840759931372097957828196257575160317269776777267577146119791778100336064925456015194243754538542334699610455019896393056983680693347453586237349705587821810634837916163602387415863182591690375715796560740876106283915254628968637600027024977447495658626537991436328970343974511498521355227614797},{"N":20793268490218684774512693601352278445028322689443202081064913550617402666303369546009318990109976551690891116697846621113236260329415649698726683348154429310525952868708067680174607651131237814389262649668448704439465047404186008154753921013350068556972563390590052728983168034463444375948350790460696065601834781420046613318177975953169145076039719844279974423558898196858668342579757145469067799367086485246344394624095341631947539315709112703850192393876968230637310789048483882845206411205681824171450223491569827707752983475885979133468267182167794367921965162019325323522468802835061922564245479973444858147861},{"N":27438879161725139321220076540395287188296500479240515950493255940764891403428090807554356381999720654096718318200443330438420074307438879662539170660002118352117651716046637491589793220699351547817403119924047799310257939494933890233479312511772178472480202130330752719668613719036474933977539005134765138424388845247118201796202963245848989959382374896142807115837703484209705782557945857352862971908895293681515057714042360383912784059531820900547414133865939496720156671373049670398455819331030650045575521560188283479234088107187942380885602975234335191026950820886138735290548666506264691790309273945731850008489}],"ECDSAPub":{"Curve":"secp256k1","Coords":[79493525990032375682542969979618533998789989364559036285904621150911797629480,36018009044469152286863753693366264314070719680968472490450927755593871021822]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_0.json b/test/_eddsa_fixtures/keygen_data_Edwards_0.json new file mode 100644 index 00000000..70b3ed7a --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_Edwards_0.json @@ -0,0 +1 @@ +{"Xi":3238859740733327761750774784175501384832375988411998142213826880226187284226,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206457,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_1.json b/test/_eddsa_fixtures/keygen_data_Edwards_1.json new file mode 100644 index 00000000..dc5cef60 --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_Edwards_1.json @@ -0,0 +1 @@ +{"Xi":6954654173463579834743715849134261898232874480821865538294887306436967887979,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206458,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_2.json b/test/_eddsa_fixtures/keygen_data_Edwards_2.json new file mode 100644 index 00000000..50609abe --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_Edwards_2.json @@ -0,0 +1 @@ +{"Xi":7059324015561833207146292565412939152570598272723739555452444331315289877399,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206459,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_3.json b/test/_eddsa_fixtures/keygen_data_Edwards_3.json new file mode 100644 index 00000000..500a2a1d --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_Edwards_3.json @@ -0,0 +1 @@ +{"Xi":3552869267028087878958504933011533147845547364117620193686497954861153252486,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206460,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_4.json b/test/_eddsa_fixtures/keygen_data_Edwards_4.json new file mode 100644 index 00000000..c969895e --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_Edwards_4.json @@ -0,0 +1 @@ +{"Xi":3672295505194606064153539514973038124914838114383415058998999115360012264229,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206461,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_0.json b/test/_eddsa_fixtures/keygen_data_S256_0.json new file mode 100644 index 00000000..ee69cf22 --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_S256_0.json @@ -0,0 +1 @@ +{"Xi":109905401803191109127809677899400594996735266654185754960047142876849164010010,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307727,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_1.json b/test/_eddsa_fixtures/keygen_data_S256_1.json new file mode 100644 index 00000000..808cf800 --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_S256_1.json @@ -0,0 +1 @@ +{"Xi":35412658026091545411326936526631994093352541143810483368934051690846997379939,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307728,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_2.json b/test/_eddsa_fixtures/keygen_data_S256_2.json new file mode 100644 index 00000000..db6e7253 --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_S256_2.json @@ -0,0 +1 @@ +{"Xi":9256698698956687494314969695792488431451621586645897467565791587816197046293,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307729,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_3.json b/test/_eddsa_fixtures/keygen_data_S256_3.json new file mode 100644 index 00000000..a8772310 --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_S256_3.json @@ -0,0 +1 @@ +{"Xi":31437523821786535376773777406882078011032507982691997255942362567756763009072,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307730,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_4.json b/test/_eddsa_fixtures/keygen_data_S256_4.json new file mode 100644 index 00000000..702ef286 --- /dev/null +++ b/test/_eddsa_fixtures/keygen_data_S256_4.json @@ -0,0 +1 @@ +{"Xi":101955133394581089058703359659900762832095200331948782734063764630668695268276,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307731,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file From f1ad1615fb376a4f4915ae971fa5dedee3b28c0d Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Fri, 24 Dec 2021 15:06:26 -0500 Subject: [PATCH 02/33] EdDSA with Schnorr (BIP340), supporting Taproot. In round 3, if R has an odd Y coordinate, add aG to it so as to ensure R with even Y coordinate. Even though BIP 340 states that only R.X is used, the R recalculation in btcd/btcec/v2 's Signature.schnorrVerify checks if R = s*G - e*P. Without adding aG to R, it could have an odd Y coordinate and fail verification. This commit also fixed a previous serialization problem with s. --- eddsa/keygen/local_party_test.go | 14 ++-- eddsa/signing/finalize.go | 84 ++++++------------- eddsa/signing/local_party.go | 3 +- eddsa/signing/local_party_test.go | 43 +++++----- eddsa/signing/round_3.go | 49 +++++++---- eddsa/signing/utils.go | 21 ++++- go.mod | 1 - test/_eddsa_fixtures/keygen_data_0.json | 1 - test/_eddsa_fixtures/keygen_data_1.json | 1 - test/_eddsa_fixtures/keygen_data_2.json | 1 - test/_eddsa_fixtures/keygen_data_3.json | 1 - test/_eddsa_fixtures/keygen_data_4.json | 1 - .../keygen_data_Edwards_0.json | 2 +- .../keygen_data_Edwards_1.json | 2 +- .../keygen_data_Edwards_2.json | 2 +- .../keygen_data_Edwards_3.json | 2 +- .../keygen_data_Edwards_4.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_0.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_1.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_2.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_3.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_4.json | 2 +- tss/curve.go | 2 +- 23 files changed, 121 insertions(+), 121 deletions(-) delete mode 100644 test/_eddsa_fixtures/keygen_data_0.json delete mode 100644 test/_eddsa_fixtures/keygen_data_1.json delete mode 100644 test/_eddsa_fixtures/keygen_data_2.json delete mode 100644 test/_eddsa_fixtures/keygen_data_3.json delete mode 100644 test/_eddsa_fixtures/keygen_data_4.json diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index f370505b..d2b9288d 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -29,8 +29,10 @@ import ( ) const ( - testParticipants = TestParticipants - testThreshold = TestThreshold + testParticipants = TestParticipants + testThreshold = TestThreshold + testSetIdS256Schnorr = "S256" + testSetIdEdwards = "Edwards" ) func setUp(level string) { @@ -43,7 +45,7 @@ func TestE2EConcurrentAndSaveFixturesEdwards(t *testing.T) { setUp("info") threshold := testThreshold - fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants, "Edwards") + fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants, testSetIdEdwards) if err != nil { common.Logger.Info("No test fixtures were found, so the safe primes will be generated from scratch. This may take a while...") pIDs = tss.GenerateTestPartyIDs(testParticipants) @@ -110,7 +112,7 @@ keygen: // .. here comes a workaround to recover this party's index (it was removed from save data) index, err := save.OriginalIndex() assert.NoErrorf(t, err, "should not be an error getting a party's index from save data") - tryWriteTestFixtureFile(t, index, "Edwards", save) + tryWriteTestFixtureFile(t, index, testSetIdEdwards, save) atomic.AddInt32(&ended, 1) if atomic.LoadInt32(&ended) == int32(len(pIDs)) { @@ -215,7 +217,7 @@ func TestE2EConcurrentAndSaveFixturesS256Schnorr(t *testing.T) { setUp("info") threshold := testThreshold - fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants, "S256") + fixtures, pIDs, err := LoadKeygenTestFixtures(testParticipants, testSetIdS256Schnorr) if err != nil { common.Logger.Info("No test fixtures were found, so the safe primes will be generated from scratch. This may take a while...") pIDs = tss.GenerateTestPartyIDs(testParticipants) @@ -282,7 +284,7 @@ keygen: // .. here comes a workaround to recover this party's index (it was removed from save data) index, err := save.OriginalIndex() assert.NoErrorf(t, err, "should not be an error getting a party's index from save data") - tryWriteTestFixtureFile(t, index, "S256", save) + tryWriteTestFixtureFile(t, index, testSetIdS256Schnorr, save) atomic.AddInt32(&ended, 1) if atomic.LoadInt32(&ended) == int32(len(pIDs)) { diff --git a/eddsa/signing/finalize.go b/eddsa/signing/finalize.go index 4cae256b..a48f27e1 100644 --- a/eddsa/signing/finalize.go +++ b/eddsa/signing/finalize.go @@ -15,8 +15,6 @@ import ( "github.com/agl/ed25519/edwards25519" "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/tss" - "github.com/btcsuite/btcd/btcec/v2" - "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/decred/dcrd/dcrec/secp256k1/v2" ) @@ -32,9 +30,12 @@ func (round *finalization) Start() *tss.Error { ok := false var s *big.Int var sumS *[32]byte - common.Logger.Debugf("curve name: %v", round.Params().EC().Params().Name) - if _, ok = round.Params().EC().(*edwards.TwistedEdwardsCurve); ok { - sumS = round.temp.si + + _, isTwistedEdwardsCurve := round.Params().EC().(*edwards.TwistedEdwardsCurve) + isSecp256k1Curve := strings.Compare("secp256k1", round.Params().EC().Params().Name) == 0 + + if isTwistedEdwardsCurve { + sumS = bigIntToEncodedBytes(&round.temp.si) for j := range round.Parties().IDs() { round.ok[j] = true if j == round.PartyID().Index { @@ -48,8 +49,8 @@ func (round *finalization) Start() *tss.Error { sumS = &tmpSumS } s = encodedBytesToBigInt(sumS) - } else if strings.Compare("secp256k1", round.Params().EC().Params().Name) == 0 { - sumSInt := encodedBytesToBigInt(round.temp.si) + } else if isSecp256k1Curve { + sumSInt := &round.temp.si modN := common.ModInt(tss.S256().Params().N) for j := range round.Parties().IDs() { round.ok[j] = true @@ -59,45 +60,47 @@ func (round *finalization) Start() *tss.Error { r3msg := round.temp.signRound3Messages[j].Content().(*SignRound3Message) sumSInt = modN.Add(sumSInt, r3msg.UnmarshalS()) } - s = sumSInt - sumS = bigIntToEncodedBytes(sumSInt) + // if we adjusted R by adding aG to find R with an even Y coordinate, add a to s also. + s = modN.Add(sumSInt, big.NewInt(int64(round.temp.a))) } // save the signature for final output signature := new(common.ECSignature) - signature.Signature = append(bigIntToEncodedBytes(round.temp.r)[:], sumS[:]...) - signature.R = bigIntToEncodedBytes(round.temp.r)[:] - signature.S = bigIntToEncodedBytes(s)[:] + if isTwistedEdwardsCurve { + signature.Signature = append(bigIntToEncodedBytes(round.temp.r)[:], sumS[:]...) + signature.R = bigIntToEncodedBytes(round.temp.r)[:] + signature.S = bigIntToEncodedBytes(s)[:] + } else if isSecp256k1Curve { + var r32b, s32b [32]byte + encode32bytes(round.temp.r, &r32b) + encode32bytes(s, &s32b) + signature.Signature = append(r32b[:], s32b[:]...) + signature.R = r32b[:] + signature.S = s32b[:] + } signature.M = round.temp.m.Bytes() round.data.R = signature.R round.data.S = signature.S round.data.Signature = append(round.data.R, round.data.S...) - if _, ok = round.Params().EC().(*edwards.TwistedEdwardsCurve); ok { + if isTwistedEdwardsCurve { pk := edwards.PublicKey{ Curve: round.Params().EC(), X: round.key.EDDSAPub.X(), Y: round.key.EDDSAPub.Y(), } - common.Logger.Debugf("pk.X: %v, r: %v, s: %s", pk.X, round.temp.r, s) ok = edwards.Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) if !ok { return round.WrapError(fmt.Errorf("edwards signature verification failed")) } - } else if strings.Compare("secp256k1", round.Params().EC().Params().Name) == 0 { + } else if isSecp256k1Curve { pk := secp256k1.PublicKey{ Curve: round.Params().EC(), X: round.key.EDDSAPub.X(), Y: round.key.EDDSAPub.Y(), } - common.Logger.Debugf("pk.X: %v, r: %v, s: %s, #m: %v", common.FormatBigInt(pk.X), - common.FormatBigInt(round.temp.r), - common.FormatBigInt(s), len(round.temp.m.Bytes())) - ok = Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) - common.Logger.Debugf("pk.X: %v, r: %v, s: %s, #m: %v, verify ok? %v", common.FormatBigInt(pk.X), - common.FormatBigInt(round.temp.r), - common.FormatBigInt(s), len(round.temp.m.Bytes()), ok) + ok = SchnorrVerify(&pk, round.temp.m.Bytes(), round.temp.r, s) if !ok { return round.WrapError(fmt.Errorf("schnorr signature verification failed")) } @@ -122,39 +125,6 @@ func (round *finalization) NextRound() tss.Round { return nil // finished! } -func Verify(p *secp256k1.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { - var r btcec.FieldVal - var s btcec.ModNScalar - r.SetByteSlice(r_.Bytes()) - s.SetByteSlice(s_.Bytes()) - signature := schnorr.NewSignature(&r, &s) - var x, y btcec.FieldVal - x.SetByteSlice(p.X.Bytes()) - y.SetByteSlice(p.Y.Bytes()) - pk := btcec.NewPublicKey(&x, &y) - // - // TODO pubKey, err := ParsePubKey(pk.SerializeCompressed()[1:]) - // - return signature.Verify(m, pk) -} - -// ParsePubKey TODO DELETE -func ParsePubKey(pubKeyStr []byte) (*btcec.PublicKey, error) { - if pubKeyStr == nil { - err := fmt.Errorf("nil pubkey byte string") - return nil, err - } - if len(pubKeyStr) != 32 { - err := fmt.Errorf("bad pubkey byte string size (want %v, have %v)", - 32, len(pubKeyStr)) - return nil, err - } - - // We'll manually prepend the compressed byte so we can re-use the - // existing pubkey parsing routine of the main btcec package. - var keyCompressed [btcec.PubKeyBytesLenCompressed]byte - keyCompressed[0] = btcec.PubKeyFormatCompressedEven - copy(keyCompressed[1:], pubKeyStr) - - return btcec.ParsePubKey(keyCompressed[:]) +func encode32bytes(i *big.Int, buff *[32]byte) { + i.FillBytes(buff[:]) } diff --git a/eddsa/signing/local_party.go b/eddsa/signing/local_party.go index 630e5b81..88e8c03a 100644 --- a/eddsa/signing/local_party.go +++ b/eddsa/signing/local_party.go @@ -63,10 +63,11 @@ type ( // round 2 cjs []*big.Int - si *[32]byte + si big.Int // round 3 r *big.Int + a int // aG, ensuring R with even Y } ) diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index 31114698..317d148e 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -15,10 +15,9 @@ import ( "testing" "github.com/agl/ed25519/edwards25519" - "github.com/btcsuite/btcd/btcec/v2" - "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/decred/dcrd/crypto/blake256" "github.com/decred/dcrd/dcrec/edwards/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v2" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" @@ -29,8 +28,10 @@ import ( ) const ( - testParticipants = test.TestParticipants - testThreshold = test.TestThreshold + testParticipants = test.TestParticipants + testThreshold = test.TestThreshold + testSetIdS256Schnorr = "S256" + testSetIdEdwards = "Edwards" ) func setUp(level string) { @@ -41,12 +42,11 @@ func setUp(level string) { func TestE2EConcurrentEdwards(t *testing.T) { setUp("debug") - t.Skip("Skipping this test for now - TODO") threshold := testThreshold // PHASE: load keygen fixtures - keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants, "S256") + keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants, testSetIdEdwards) assert.NoError(t, err, "should load keygen fixtures") assert.Equal(t, testThreshold+1, len(keys)) assert.Equal(t, testThreshold+1, len(signPIDs)) @@ -109,14 +109,14 @@ signing: R := parties[0].temp.r // BEGIN check s correctness - sumS := parties[0].temp.si + sumS := bigIntToEncodedBytes(&parties[0].temp.si) for i, p := range parties { if i == 0 { continue } var tmpSumS [32]byte - edwards25519.ScMulAdd(&tmpSumS, sumS, bigIntToEncodedBytes(big.NewInt(1)), p.temp.si) + edwards25519.ScMulAdd(&tmpSumS, sumS, bigIntToEncodedBytes(big.NewInt(1)), bigIntToEncodedBytes(&p.temp.si)) sumS = &tmpSumS } // END check s correctness @@ -156,12 +156,12 @@ signing: func TestE2EConcurrentS256Schnorr(t *testing.T) { setUp("debug") - t.Skip("Skipping this test for now - TODO") threshold := testThreshold // PHASE: load keygen fixtures - keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants, "S256") + + keys, signPIDs, err := keygen.LoadKeygenTestFixturesRandomSet(testThreshold+1, testParticipants, testSetIdS256Schnorr) assert.NoError(t, err, "should load keygen fixtures") assert.Equal(t, testThreshold+1, len(keys)) assert.Equal(t, testThreshold+1, len(signPIDs)) @@ -230,7 +230,7 @@ signing: // BEGIN check s correctness sumS := big.NewInt(0) for _, p := range parties { - sumS = modN.Add(sumS, encodedBytesToBigInt(p.temp.si)) + sumS = modN.Add(sumS, &p.temp.si) } fmt.Printf("S: %s\n", common.FormatBigInt(sumS)) fmt.Printf("R: %s\n", R.String()) @@ -238,16 +238,17 @@ signing: // BEGIN EdDSA verify pkX, pkY := keys[0].EDDSAPub.X(), keys[0].EDDSAPub.Y() - var r btcec.FieldVal - var s btcec.ModNScalar - r.SetByteSlice(parties[0].data.GetR()) - s.SetByteSlice(parties[0].data.GetS()) - signature := schnorr.NewSignature(&r, &s) - var x, y btcec.FieldVal - x.SetByteSlice(pkX.Bytes()) - y.SetByteSlice(pkY.Bytes()) - pk := btcec.NewPublicKey(&x, &y) - ok := signature.Verify(msg_, pk) + pk := secp256k1.PublicKey{ + Curve: tss.S256(), + X: pkX, + Y: pkY, + } + + r := new(big.Int).SetBytes(parties[0].data.GetR()) + s := new(big.Int).SetBytes(parties[0].data.GetS()) + + ok := SchnorrVerify(&pk, msg_, r, s) + assert.True(t, ok, "eddsa verify must pass") t.Log("EdDSA signing test done.") // END EdDSA verify diff --git a/eddsa/signing/round_3.go b/eddsa/signing/round_3.go index 6688256a..037f0e77 100644 --- a/eddsa/signing/round_3.go +++ b/eddsa/signing/round_3.go @@ -7,12 +7,11 @@ package signing import ( - "encoding/hex" "math/big" "strings" "github.com/agl/ed25519/edwards25519" - "github.com/binance-chain/tss-lib/common" + "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/pkg/errors" @@ -87,7 +86,6 @@ func (round *round3) Start() *tss.Error { } } - // 7. compute lambda var encodedR [32]byte var encodedPubKey *[32]byte @@ -97,13 +95,13 @@ func (round *round3) Start() *tss.Error { } else if isSecp256k1Curve { s := new([32]byte) round.key.EDDSAPub.X().FillBytes(s[:]) - serializeR(Rsecp256k1, &encodedR) - common.Logger.Debugf("r3, encodedR: %s", hex.EncodeToString(encodedR[:])) encodedPubKey = s } + // 7. compute lambda // h = hash512(k || A || M) var lambda [64]byte + var 𝜆 *chainhash.Hash var lambdaReduced [32]byte if isTwistedEdwardsCurve { h := round.EdDSAParameters.hashingAlgorithm @@ -115,28 +113,47 @@ func (round *round3) Start() *tss.Error { edwards25519.ScReduce(&lambdaReduced, &lambda) } else if isSecp256k1Curve { - 𝜆 := chainhash.TaggedHash( + // if R has an odd Y coordinate, we'll add to it until we find an R with even Y. + a := 0 + G := crypto.ScalarBaseMult(round.Params().EC(), big.NewInt(1)) + for ; oddY(Rsecp256k1); a++ { // Y cannot be odd in BIP340 + Rsecp256k1, _ = Rsecp256k1.Add(G) + } + round.temp.a = a + + // + encode32bytes(Rsecp256k1.X(), &encodedR) + 𝜆 = chainhash.TaggedHash( []byte("BIP0340/challenge"), encodedR[:], encodedPubKey[:], round.temp.m.Bytes(), - ) - copy(lambda[:0], 𝜆.CloneBytes()) + ) // commitment + var e btcec.ModNScalar + if overflow := e.SetBytes((*[32]byte)(𝜆)); overflow != 0 { + str := "hash of (r || P || m) too big" + return round.WrapError(errors.New(str)) + } } // 8. compute si var localS [32]byte + var si *big.Int if isTwistedEdwardsCurve { edwards25519.ScMulAdd(&localS, &lambdaReduced, bigIntToEncodedBytes(round.temp.wi), riBytes) + si = encodedBytesToBigInt(&localS) } else if isSecp256k1Curve { - 𝜆wi := big.NewInt(0).Mul(big.NewInt(0).SetBytes(lambda[:0]), round.temp.wi) - si := big.NewInt(0).Add(round.temp.ri, 𝜆wi) - localS = *bigIntToEncodedBytes(si) + 𝜆wi := big.NewInt(0).Mul(big.NewInt(0).SetBytes(𝜆.CloneBytes()), round.temp.wi) + si = big.NewInt(0).Add(round.temp.ri, 𝜆wi) } // 9. store r3 message pieces - round.temp.si = &localS - round.temp.r = encodedBytesToBigInt(&encodedR) + round.temp.si = *si + if isTwistedEdwardsCurve { + round.temp.r = encodedBytesToBigInt(&encodedR) + } else if isSecp256k1Curve { + round.temp.r = Rsecp256k1.X() + } // 10. broadcast si to other parties - r3msg := NewSignRound3Message(round.PartyID(), encodedBytesToBigInt(&localS)) + r3msg := NewSignRound3Message(round.PartyID(), si) round.temp.signRound3Messages[round.PartyID().Index] = r3msg round.out <- r3msg @@ -156,10 +173,6 @@ func (round *round3) Update() (bool, *tss.Error) { return true, nil } -func serializeR(Rsecp256k1 *crypto.ECPoint, encodedR *[32]byte) { - Rsecp256k1.X().FillBytes(encodedR[:]) -} - func (round *round3) CanAccept(msg tss.ParsedMessage) bool { if _, ok := msg.Content().(*SignRound3Message); ok { return msg.IsBroadcast() diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index 2cda9b6d..c79bbccf 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -11,8 +11,11 @@ import ( "math/big" "github.com/agl/ed25519/edwards25519" - "github.com/binance-chain/tss-lib/common" + "github.com/binance-chain/tss-lib/crypto" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr" + secp256k12 "github.com/decred/dcrd/dcrec/secp256k1/v2" ) func encodedBytesToBigInt(s *[32]byte) *big.Int { @@ -126,3 +129,19 @@ func ecPointToExtendedElement(ec elliptic.Curve, x *big.Int, y *big.Int) edwards T: T, } } + +func oddY(a *crypto.ECPoint) bool { + return a.Y().Bit(0) > 0 +} + +func SchnorrVerify(p *secp256k12.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { + var r btcec.FieldVal + var s btcec.ModNScalar + r.SetByteSlice(r_.Bytes()) + s.SetByteSlice(s_.Bytes()) + signature := schnorr.NewSignature(&r, &s) + var x, y btcec.FieldVal + x.SetByteSlice(p.X.Bytes()) + y.SetByteSlice(p.Y.Bytes()) + return signature.Verify(m, btcec.NewPublicKey(&x, &y)) +} diff --git a/go.mod b/go.mod index f4fb20da..57071907 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/decred/dcrd/crypto/blake256 v1.0.0 github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 - // github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 github.com/golang/protobuf v1.5.2 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 diff --git a/test/_eddsa_fixtures/keygen_data_0.json b/test/_eddsa_fixtures/keygen_data_0.json deleted file mode 100644 index 78edff9e..00000000 --- a/test/_eddsa_fixtures/keygen_data_0.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":4035558533062709819999066175720808528201062157116959842237332813932238616128,"ShareID":4331412928177670560630249357713645140224222675389722735738732090810250798211,"Ks":[4331412928177670560630249357713645140224222675389722735738732090810250798211,4331412928177670560630249357713645140224222675389722735738732090810250798212,4331412928177670560630249357713645140224222675389722735738732090810250798213,4331412928177670560630249357713645140224222675389722735738732090810250798214,4331412928177670560630249357713645140224222675389722735738732090810250798215],"BigXj":[{"Curve":"ed25519","Coords":[43310099667191579169521946934030711066313578772454024333166342656953690707905,38262908547499520970138465680473622143445318034940413117238454107324155485797]},{"Curve":"ed25519","Coords":[24927223220985169141357864268825305163035760221331262595481037667448513230521,54543586647335403608940330836676147882229516532084699385623699026578670835490]},{"Curve":"ed25519","Coords":[19616187786153771277930658236501515378058310865337414616528052406614836915381,5716086794073894084115757926314451153376043864681595081544933294419482836932]},{"Curve":"ed25519","Coords":[54894815670576274903749323651006626882715390257891571131934873815604647096151,6261975146537300228952779313756496780554610579250869076285924817563901726620]},{"Curve":"ed25519","Coords":[56199043572031726140854435832515077152685912346629787788574432437354212337803,20932642671481609624660147804972444129208387391842241879798619789962570609578]}],"EDDSAPub":{"Curve":"ed25519","Coords":[19086049614490163056889859244855881816030591019773605655349500169700108043042,41654918635428963527745188055885714592211199796738262868910566706065491471139]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_1.json b/test/_eddsa_fixtures/keygen_data_1.json deleted file mode 100644 index c8f4f027..00000000 --- a/test/_eddsa_fixtures/keygen_data_1.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":3043586451770172198202994337291909300581990387576065449561143874105554349662,"ShareID":4331412928177670560630249357713645140224222675389722735738732090810250798212,"Ks":[4331412928177670560630249357713645140224222675389722735738732090810250798211,4331412928177670560630249357713645140224222675389722735738732090810250798212,4331412928177670560630249357713645140224222675389722735738732090810250798213,4331412928177670560630249357713645140224222675389722735738732090810250798214,4331412928177670560630249357713645140224222675389722735738732090810250798215],"BigXj":[{"Curve":"ed25519","Coords":[43310099667191579169521946934030711066313578772454024333166342656953690707905,38262908547499520970138465680473622143445318034940413117238454107324155485797]},{"Curve":"ed25519","Coords":[24927223220985169141357864268825305163035760221331262595481037667448513230521,54543586647335403608940330836676147882229516532084699385623699026578670835490]},{"Curve":"ed25519","Coords":[19616187786153771277930658236501515378058310865337414616528052406614836915381,5716086794073894084115757926314451153376043864681595081544933294419482836932]},{"Curve":"ed25519","Coords":[54894815670576274903749323651006626882715390257891571131934873815604647096151,6261975146537300228952779313756496780554610579250869076285924817563901726620]},{"Curve":"ed25519","Coords":[56199043572031726140854435832515077152685912346629787788574432437354212337803,20932642671481609624660147804972444129208387391842241879798619789962570609578]}],"EDDSAPub":{"Curve":"ed25519","Coords":[19086049614490163056889859244855881816030591019773605655349500169700108043042,41654918635428963527745188055885714592211199796738262868910566706065491471139]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_2.json b/test/_eddsa_fixtures/keygen_data_2.json deleted file mode 100644 index 30a7bbda..00000000 --- a/test/_eddsa_fixtures/keygen_data_2.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":3816246280213061394677789505107161438228093145050056017416883247327953924913,"ShareID":4331412928177670560630249357713645140224222675389722735738732090810250798213,"Ks":[4331412928177670560630249357713645140224222675389722735738732090810250798211,4331412928177670560630249357713645140224222675389722735738732090810250798212,4331412928177670560630249357713645140224222675389722735738732090810250798213,4331412928177670560630249357713645140224222675389722735738732090810250798214,4331412928177670560630249357713645140224222675389722735738732090810250798215],"BigXj":[{"Curve":"ed25519","Coords":[43310099667191579169521946934030711066313578772454024333166342656953690707905,38262908547499520970138465680473622143445318034940413117238454107324155485797]},{"Curve":"ed25519","Coords":[24927223220985169141357864268825305163035760221331262595481037667448513230521,54543586647335403608940330836676147882229516532084699385623699026578670835490]},{"Curve":"ed25519","Coords":[19616187786153771277930658236501515378058310865337414616528052406614836915381,5716086794073894084115757926314451153376043864681595081544933294419482836932]},{"Curve":"ed25519","Coords":[54894815670576274903749323651006626882715390257891571131934873815604647096151,6261975146537300228952779313756496780554610579250869076285924817563901726620]},{"Curve":"ed25519","Coords":[56199043572031726140854435832515077152685912346629787788574432437354212337803,20932642671481609624660147804972444129208387391842241879798619789962570609578]}],"EDDSAPub":{"Curve":"ed25519","Coords":[19086049614490163056889859244855881816030591019773605655349500169700108043042,41654918635428963527745188055885714592211199796738262868910566706065491471139]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_3.json b/test/_eddsa_fixtures/keygen_data_3.json deleted file mode 100644 index d2b69df9..00000000 --- a/test/_eddsa_fixtures/keygen_data_3.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":6353538018391377409423451679166564941139370429538931545804550933599437341881,"ShareID":4331412928177670560630249357713645140224222675389722735738732090810250798214,"Ks":[4331412928177670560630249357713645140224222675389722735738732090810250798211,4331412928177670560630249357713645140224222675389722735738732090810250798212,4331412928177670560630249357713645140224222675389722735738732090810250798213,4331412928177670560630249357713645140224222675389722735738732090810250798214,4331412928177670560630249357713645140224222675389722735738732090810250798215],"BigXj":[{"Curve":"ed25519","Coords":[43310099667191579169521946934030711066313578772454024333166342656953690707905,38262908547499520970138465680473622143445318034940413117238454107324155485797]},{"Curve":"ed25519","Coords":[24927223220985169141357864268825305163035760221331262595481037667448513230521,54543586647335403608940330836676147882229516532084699385623699026578670835490]},{"Curve":"ed25519","Coords":[19616187786153771277930658236501515378058310865337414616528052406614836915381,5716086794073894084115757926314451153376043864681595081544933294419482836932]},{"Curve":"ed25519","Coords":[54894815670576274903749323651006626882715390257891571131934873815604647096151,6261975146537300228952779313756496780554610579250869076285924817563901726620]},{"Curve":"ed25519","Coords":[56199043572031726140854435832515077152685912346629787788574432437354212337803,20932642671481609624660147804972444129208387391842241879798619789962570609578]}],"EDDSAPub":{"Curve":"ed25519","Coords":[19086049614490163056889859244855881816030591019773605655349500169700108043042,41654918635428963527745188055885714592211199796738262868910566706065491471139]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_4.json b/test/_eddsa_fixtures/keygen_data_4.json deleted file mode 100644 index eec4b008..00000000 --- a/test/_eddsa_fixtures/keygen_data_4.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":3418456088972858028466794296427125568458705881662784428722195994634550349577,"ShareID":4331412928177670560630249357713645140224222675389722735738732090810250798215,"Ks":[4331412928177670560630249357713645140224222675389722735738732090810250798211,4331412928177670560630249357713645140224222675389722735738732090810250798212,4331412928177670560630249357713645140224222675389722735738732090810250798213,4331412928177670560630249357713645140224222675389722735738732090810250798214,4331412928177670560630249357713645140224222675389722735738732090810250798215],"BigXj":[{"Curve":"ed25519","Coords":[43310099667191579169521946934030711066313578772454024333166342656953690707905,38262908547499520970138465680473622143445318034940413117238454107324155485797]},{"Curve":"ed25519","Coords":[24927223220985169141357864268825305163035760221331262595481037667448513230521,54543586647335403608940330836676147882229516532084699385623699026578670835490]},{"Curve":"ed25519","Coords":[19616187786153771277930658236501515378058310865337414616528052406614836915381,5716086794073894084115757926314451153376043864681595081544933294419482836932]},{"Curve":"ed25519","Coords":[54894815670576274903749323651006626882715390257891571131934873815604647096151,6261975146537300228952779313756496780554610579250869076285924817563901726620]},{"Curve":"ed25519","Coords":[56199043572031726140854435832515077152685912346629787788574432437354212337803,20932642671481609624660147804972444129208387391842241879798619789962570609578]}],"EDDSAPub":{"Curve":"ed25519","Coords":[19086049614490163056889859244855881816030591019773605655349500169700108043042,41654918635428963527745188055885714592211199796738262868910566706065491471139]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_0.json b/test/_eddsa_fixtures/keygen_data_Edwards_0.json index 70b3ed7a..4d1601d1 100644 --- a/test/_eddsa_fixtures/keygen_data_Edwards_0.json +++ b/test/_eddsa_fixtures/keygen_data_Edwards_0.json @@ -1 +1 @@ -{"Xi":3238859740733327761750774784175501384832375988411998142213826880226187284226,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206457,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file +{"Xi":7105808523625428964759423666854551422596090594583987980505846034450582466514,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038533,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_1.json b/test/_eddsa_fixtures/keygen_data_Edwards_1.json index dc5cef60..b8b5bfbd 100644 --- a/test/_eddsa_fixtures/keygen_data_Edwards_1.json +++ b/test/_eddsa_fixtures/keygen_data_Edwards_1.json @@ -1 +1 @@ -{"Xi":6954654173463579834743715849134261898232874480821865538294887306436967887979,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206458,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file +{"Xi":2216525522515784517964725114221640359762439686454275896305189035784864889792,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038534,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_2.json b/test/_eddsa_fixtures/keygen_data_Edwards_2.json index 50609abe..bb448be5 100644 --- a/test/_eddsa_fixtures/keygen_data_Edwards_2.json +++ b/test/_eddsa_fixtures/keygen_data_Edwards_2.json @@ -1 +1 @@ -{"Xi":7059324015561833207146292565412939152570598272723739555452444331315289877399,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206459,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file +{"Xi":6798805106169397120784711413352223126177177410429886385878008545729134605226,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038535,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_3.json b/test/_eddsa_fixtures/keygen_data_Edwards_3.json index 500a2a1d..115011e0 100644 --- a/test/_eddsa_fixtures/keygen_data_Edwards_3.json +++ b/test/_eddsa_fixtures/keygen_data_Edwards_3.json @@ -1 +1 @@ -{"Xi":3552869267028087878958504933011533147845547364117620193686497954861153252486,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206460,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file +{"Xi":6378636119921742345273009438160311240126071047751004237220402687712483110838,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038536,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_4.json b/test/_eddsa_fixtures/keygen_data_Edwards_4.json index c969895e..e3b3db3e 100644 --- a/test/_eddsa_fixtures/keygen_data_Edwards_4.json +++ b/test/_eddsa_fixtures/keygen_data_Edwards_4.json @@ -1 +1 @@ -{"Xi":3672295505194606064153539514973038124914838114383415058998999115360012264229,"ShareID":63851258860143065354753593374202141498498198387178435527901517665056395206461,"Ks":[63851258860143065354753593374202141498498198387178435527901517665056395206457,63851258860143065354753593374202141498498198387178435527901517665056395206458,63851258860143065354753593374202141498498198387178435527901517665056395206459,63851258860143065354753593374202141498498198387178435527901517665056395206460,63851258860143065354753593374202141498498198387178435527901517665056395206461],"BigXj":[{"Curve":"ed25519","Coords":[56426416687219763171230261571038601419757005182409903764038075698683308830787,34138938162974438220650407855756932882213139862474329590481686089227543936664]},{"Curve":"ed25519","Coords":[18812792689774290477648256197240298265623187732708594449858661596119423792914,17894738813509875385277856141125553495045632977444210266994234677534138400477]},{"Curve":"ed25519","Coords":[50921533799097782093312349199568104703657961899162049371793048134389134213488,47420026419170266083909616455367868330403995595041000548032882809305098833406]},{"Curve":"ed25519","Coords":[1932327168952836587903267533975286575465623619759493882023179073198178837686,2384433890590410703602534138780820023959540134714669897949246673493639876724]},{"Curve":"ed25519","Coords":[45871280760665844911468163764740568262515981593496266632273848047657172920528,9941038074725033230717213025676798405823966611656973810413807699217447185452]}],"EDDSAPub":{"Curve":"ed25519","Coords":[7574985246646703539386597382878147185961891540709082664285910644416154115498,53319265536758963198776339565506834111129352540813574904781977425137628302148]}} \ No newline at end of file +{"Xi":956018563772820191429619188645904701609120598417629450332371461734910406628,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038537,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_0.json b/test/_eddsa_fixtures/keygen_data_S256_0.json index ee69cf22..728fff4f 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_0.json +++ b/test/_eddsa_fixtures/keygen_data_S256_0.json @@ -1 +1 @@ -{"Xi":109905401803191109127809677899400594996735266654185754960047142876849164010010,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307727,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file +{"Xi":42741719578003277110582513504028795704694674906236788659488762645533730839619,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161732,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_1.json b/test/_eddsa_fixtures/keygen_data_S256_1.json index 808cf800..b3e8f862 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_1.json +++ b/test/_eddsa_fixtures/keygen_data_S256_1.json @@ -1 +1 @@ -{"Xi":35412658026091545411326936526631994093352541143810483368934051690846997379939,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307728,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file +{"Xi":59608870410834845924306616907593500926448036944113633360241219791171723219726,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161733,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_2.json b/test/_eddsa_fixtures/keygen_data_S256_2.json index db6e7253..069619f6 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_2.json +++ b/test/_eddsa_fixtures/keygen_data_S256_2.json @@ -1 +1 @@ -{"Xi":9256698698956687494314969695792488431451621586645897467565791587816197046293,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307729,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file +{"Xi":2401696278359958102346236097539528009776582051381760491570827131962171137087,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161734,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_3.json b/test/_eddsa_fixtures/keygen_data_S256_3.json index a8772310..8f296d68 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_3.json +++ b/test/_eddsa_fixtures/keygen_data_S256_3.json @@ -1 +1 @@ -{"Xi":31437523821786535376773777406882078011032507982691997255942362567756763009072,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307730,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file +{"Xi":102704375655211004491843341091242692660355438786190978818687910950941397580376,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161735,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_4.json b/test/_eddsa_fixtures/keygen_data_S256_4.json index 702ef286..2a4083b0 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_4.json +++ b/test/_eddsa_fixtures/keygen_data_S256_4.json @@ -1 +1 @@ -{"Xi":101955133394581089058703359659900762832095200331948782734063764630668695268276,"ShareID":79096912353040506265220934635701246632531315647805106435583317142829791307731,"Ks":[79096912353040506265220934635701246632531315647805106435583317142829791307727,79096912353040506265220934635701246632531315647805106435583317142829791307728,79096912353040506265220934635701246632531315647805106435583317142829791307729,79096912353040506265220934635701246632531315647805106435583317142829791307730,79096912353040506265220934635701246632531315647805106435583317142829791307731],"BigXj":[{"Curve":"secp256k1","Coords":[83936793864836228333248110552819084958649427524208174445364033453218229365198,78883570441831011832820394028735280143550999503126962360691765509116505370435]},{"Curve":"secp256k1","Coords":[41826066634564324697609744815425313203898959951741393023094755554847221538553,32994296454356335203614123519826483155235316769249215957106842548084790243051]},{"Curve":"secp256k1","Coords":[34459480233201783620833280610448037821602578541891985491059629218031178920701,109026611934009483719508479135869763940224582003342268065465620002349543665193]},{"Curve":"secp256k1","Coords":[31727612033481451886579870489843016603407556728835331697856297677883016453725,88302321366502062360961639522898344306282359160537277869385826389483642780120]},{"Curve":"secp256k1","Coords":[108636852123185386464980491527260456296633479338916364993413206294519020961676,90623087433638158956035568071665090122819633804040683256712139855028744423176]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[43468504477387277275991116220212044053526681422375886329417108551775199128330,19200184500391466726249824766873897246831968441578578058227783976960988869495]}} \ No newline at end of file +{"Xi":13140640829439398822084976862639271319671914311316575193776981823554918066582,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161736,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file diff --git a/tss/curve.go b/tss/curve.go index 798767a6..68c99bd6 100644 --- a/tss/curve.go +++ b/tss/curve.go @@ -11,7 +11,7 @@ import ( "errors" "reflect" - s256k1 "github.com/btcsuite/btcd/btcec" + s256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/decred/dcrd/dcrec/edwards/v2" ) From e42ec2887f7b667fcf50d72ae8194fe9ab642c2d Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Sun, 26 Dec 2021 21:30:15 -0500 Subject: [PATCH 03/33] Curve name in fixture file suffix for resharing. Exposing EdDSA hashing algorithm externally. --- eddsa/resharing/local_party_test.go | 12 ++++++++---- eddsa/signing/local_party.go | 2 +- eddsa/signing/local_party_test.go | 4 ++-- eddsa/signing/round_3.go | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/eddsa/resharing/local_party_test.go b/eddsa/resharing/local_party_test.go index 105be357..bbf8b0a1 100644 --- a/eddsa/resharing/local_party_test.go +++ b/eddsa/resharing/local_party_test.go @@ -7,6 +7,7 @@ package resharing_test import ( + "crypto/sha512" "math/big" "sync/atomic" "testing" @@ -25,8 +26,10 @@ import ( ) const ( - testParticipants = test.TestParticipants - testThreshold = test.TestThreshold + testParticipants = test.TestParticipants + testThreshold = test.TestThreshold + testSetIdS256Schnorr = "S256" + testSetIdEdwards = "Edwards" ) func setUp(level string) { @@ -45,7 +48,7 @@ func TestE2EConcurrent(t *testing.T) { // PHASE: load keygen fixtures firstPartyIdx, extraParties := 0, 1 // // extra can be 0 to N-first - oldKeys, oldPIDs, err := keygen.LoadKeygenTestFixtures(testThreshold+1+extraParties+firstPartyIdx, firstPartyIdx) + oldKeys, oldPIDs, err := keygen.LoadKeygenTestFixtures(testThreshold+1+extraParties+firstPartyIdx, testSetIdEdwards, firstPartyIdx) assert.NoError(t, err, "should load keygen fixtures") // PHASE: resharing @@ -165,7 +168,8 @@ signing: for j, signPID := range signPIDs { params := tss.NewParameters(tss.Edwards(), signP2pCtx, signPID, len(signPIDs), newThreshold) - P := signing.NewLocalParty(big.NewInt(42), params, signKeys[j], signOutCh, signEndCh).(*signing.LocalParty) + edDSAParameters := &signing.EdDSAParameters{Parameters: params, HashingAlgorithm: sha512.New()} + P := signing.NewLocalParty(big.NewInt(42), edDSAParameters, signKeys[j], signOutCh, signEndCh).(*signing.LocalParty) signParties = append(signParties, P) go func(P *signing.LocalParty) { if err := P.Start(); err != nil { diff --git a/eddsa/signing/local_party.go b/eddsa/signing/local_party.go index 88e8c03a..15713072 100644 --- a/eddsa/signing/local_party.go +++ b/eddsa/signing/local_party.go @@ -29,7 +29,7 @@ type HashingAlgorithm int type ( EdDSAParameters struct { *tss.Parameters - hashingAlgorithm hash.Hash + HashingAlgorithm hash.Hash } LocalParty struct { diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index 317d148e..2d99cf96 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -67,7 +67,7 @@ func TestE2EConcurrentEdwards(t *testing.T) { for i := 0; i < len(signPIDs); i++ { params := tss.NewParameters(edwards.Edwards(), p2pCtx, signPIDs[i], len(signPIDs), threshold) - edDSAParameters := &EdDSAParameters{Parameters: params, hashingAlgorithm: sha512.New()} + edDSAParameters := &EdDSAParameters{Parameters: params, HashingAlgorithm: sha512.New()} P := NewLocalParty(msg, edDSAParameters, keys[i], outCh, endCh).(*LocalParty) parties = append(parties, P) go func(P *LocalParty) { @@ -183,7 +183,7 @@ func TestE2EConcurrentS256Schnorr(t *testing.T) { // init the parties for i := 0; i < len(signPIDs); i++ { params := tss.NewParameters(tss.S256(), p2pCtx, signPIDs[i], len(signPIDs), threshold) - edDSAParameters := &EdDSAParameters{Parameters: params, hashingAlgorithm: blake256.New()} + edDSAParameters := &EdDSAParameters{Parameters: params, HashingAlgorithm: blake256.New()} P := NewLocalParty(msg, edDSAParameters, keys[i], outCh, endCh).(*LocalParty) parties = append(parties, P) diff --git a/eddsa/signing/round_3.go b/eddsa/signing/round_3.go index 037f0e77..5195b0a4 100644 --- a/eddsa/signing/round_3.go +++ b/eddsa/signing/round_3.go @@ -104,7 +104,7 @@ func (round *round3) Start() *tss.Error { var 𝜆 *chainhash.Hash var lambdaReduced [32]byte if isTwistedEdwardsCurve { - h := round.EdDSAParameters.hashingAlgorithm + h := round.EdDSAParameters.HashingAlgorithm h.Reset() h.Write(encodedR[:]) h.Write(encodedPubKey[:]) From da94e854434879d0e9be92ad5ebb50df1356cebf Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Mon, 27 Dec 2021 08:43:53 -0500 Subject: [PATCH 04/33] Adding ecdsa fixtures back. --- test/_ecdsa_fixtures/keygen_data_0.json | 1 + test/_ecdsa_fixtures/keygen_data_1.json | 1 + test/_ecdsa_fixtures/keygen_data_2.json | 1 + test/_ecdsa_fixtures/keygen_data_3.json | 1 + test/_ecdsa_fixtures/keygen_data_4.json | 1 + 5 files changed, 5 insertions(+) create mode 100644 test/_ecdsa_fixtures/keygen_data_0.json create mode 100644 test/_ecdsa_fixtures/keygen_data_1.json create mode 100644 test/_ecdsa_fixtures/keygen_data_2.json create mode 100644 test/_ecdsa_fixtures/keygen_data_3.json create mode 100644 test/_ecdsa_fixtures/keygen_data_4.json diff --git a/test/_ecdsa_fixtures/keygen_data_0.json b/test/_ecdsa_fixtures/keygen_data_0.json new file mode 100644 index 00000000..bdfc8cf0 --- /dev/null +++ b/test/_ecdsa_fixtures/keygen_data_0.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,"LambdaN":10812068832893660299642954853261212300141417956157022207301487519451795113663473079004365766701371639662862872698905465522170109446008320189219096753245083503808850225878684350020700922043634311494740550351606830704158075010744927386667954501509148753333093308033705375234902496727956015699976147977751462284274573217035723036620143848464849587038753406494800781971774785272895229303767153090846470978987892576160496406478758337770127976724364005118716004783230795128301701278030234216992521310552045470752943756068836826384513258633962922485583433823103731965994456953510368820600195567636921650077471824976346308314,"PhiN":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568549146434071446073240287696929699174077506812989601563943549570545790458607534306181692941957975785152320992812957516675540255953448728010237432009566461590256603402556060468433985042621104090941505887512137673652769026517267925844971166867646207463931988913907020737641200391135273843300154943649952692616628},"NTildei":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,"H1i":10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,"H2i":6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,"Alpha":7595449564670872179836477275908037953129653706099200313612545475640696571205045954514917036862616897292196838334038624984783777811792793730646019053784472582201667916824934432528927054625275697052379541804780291471097102935375275559126685377170445312431427279089963191137566830129693620426603351718458658339904913056645805615531913246798978513641159830240202501185483903859297375192265370256689451220893032101113516504943791441297236917682387308685422276414745681957760650855311004851432989686465750487368742890159383897427473076580830927300722407422012686395926029290086559013126325693805633691595395331010149629841,"Beta":1027994974675799020269188236528404506067863668700434115918821680859143024024051101026472614778588741429660646024583229553176672893620319756764640159488380199855292255335690957748930582951693958190728775981804204068906506791037967650802152813108413328413417469434890897948934960325900585114782675229282123902634376520395967293593515322512481219663421902465150396456168099527663396564750257218428768468231328800853696204183368043333071206585128173731406212943850768933974944397200327729256046701874461263459119140988700544659395931114993153640032150356186411170833409638565582627741629692020796888643605183559381315817,"P":68991576126999044763117577276740358704221158228349017685354104041451304594550087413364019473650780604747497398586722829026853638558729121817627337104338573405363502758051310664021633268414376730467201407009106225068020163387897959773237819305728262319287383442723863515441870698829647061097158914185910479043,"Q":78357891208275236627704132844638967505727136897249392050334637565744827651337881645139210846144691383980195959627043801332638404871115228048764535152878932535563715366752817685769039331584155318869945144310164566511368077496914079871127729568934180084552788321059656200580749646177736416497176633404154512399,"Xi":86882326043955128902291758966201254169153327036684852284159457743375650973048,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489040,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_1.json b/test/_ecdsa_fixtures/keygen_data_1.json new file mode 100644 index 00000000..905e1965 --- /dev/null +++ b/test/_ecdsa_fixtures/keygen_data_1.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,"LambdaN":11137956536116728553533500395428451601937907560251152155674472349747393278550902374805203189353102834940517226275198181715825377282693565984672447720733449033718692389263013140561805920219907491342868930367016454981277614770343294598209676941141625911935385402684784009930494717577522158278477998604707443932446572206083755925638902624031405762652181902790017185587634857824480710523500761333532762995781906113380250008829115160537264396132695189297867307554653731355462516355743386611556342349225481687985733438526123072435686256928342633620521607360207158773825605215371733054347127924142497731440082243061219303374,"PhiN":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887864893144412167511851277805248062811525304363805580034371175269715648961421047001522667065525991563812226760500017658230321074528792265390378595734615109307462710925032711486773223112684698450963375971466877052246144871372513856685267241043214720414317547651210430743466108694255848284995462880164486122438606748},"NTildei":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,"H1i":21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,"H2i":16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,"Alpha":19967099213057383204914591612348835331244244684028038021878115815864643573607628386446351499446200880387710860948899185986317102791981062603688749791834556633594205763898348025423391597477151856368277209373438379436740859320397192190507622036448297319546108508134334691866409509968257127952443932908574529240100673892633092982611976133212375618143746338838773295112497685320322825353865957846712093476995952276628750116582462083820106500643909892067084214142544462317455756985566169802527472194331626964146495919323915789852196739767934502128834813237756300773459124426930549694672300612745005157289225829046350443320,"Beta":3351475445362306343544843146465370022135133221365325506584021437514696447073948607326649530719303449337110205011702282653904760204797540060923677589194216826915473649054874657459548099182316245009334179128713393579774696758223949311450143727953182778076964590579175143090049021134409185976574232660134615307018089813779265641779151263093689588776610320635622357442436913826502155254236496975201392693152798104129408586377602168061032332931385558367833233595526966450052507688984376025229783175162471263401610881203556925958631613068118667831049588152512008911378119398081162801501653098448083895244508503980932329304,"P":67540229384891656651844409391875278535805971140948327835825253518964040924956630563890483414254434230996384170513874345556138744209300641536643162668879213350019072855562559031148859513968109053200459482678466700805056671295718307762574867288867804899308020037617336551287471091739602493683556348162668608519,"Q":82454239773489890482601504410068018479564035393091640688098690156904828618963259497168181955828501964425440407700511627488548564722308038651058595482447426110786974964277667568243088724411005453927224207936026176937488326060322043068958665413144464233716704135283671792628564920677513466392685342003840554273,"Xi":13421620875548478783685264280130319540279412396204581856067409123990702149827,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489041,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_2.json b/test/_ecdsa_fixtures/keygen_data_2.json new file mode 100644 index 00000000..5587d69c --- /dev/null +++ b/test/_ecdsa_fixtures/keygen_data_2.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,"LambdaN":12420174977816159768311836730868502614606980910361058805906914825990452582769684498532625303826496390788057476364690369033348910630370844412471907376472448255946775272702176019420549055565394588459229953771843514900476425975252868226750526399534255439005673214064922572894193821907072960548814583613552687379309538427375607008218775816300776187253059782533723985373842578966416587039402171269391160038210734265338283579700935300307821195483456552169694400094669193456808849319380040981741270689036563708586105601750505972144644064560987505643057593076017807661075223397694172234464164248776409258536386052322074034722,"PhiN":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758619076854751214016437551632601552374506119565067447970747685157932833174078804342538782320076421468530676567159401870600615642390966913104339388800189338386913617698638760081963482541378073127417172211203501011944289288129121975011286115186152035615322150446795388344468928328497552818517072772104644148069444},"NTildei":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,"H1i":24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,"H2i":23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,"Alpha":17655234602770014706164981089031841683665803713932271722226797850226403995605541927692042640477641853463934810471638522690893118776942115965508831824078878274643089359138444086268807471114070221974326455554609460391587567561452191188243374650196796601849689889308227931995508911996301774738967035270322644410869733878456201891181129502121100168142146902942570932980726113126040739996443147449216612643223593370740309431549523547806898610508891955228214945361645474072676835320321662102868905894918372384225929497183230772035361573090638376749181605205505644969098549520935639405513795519466715171518273403001255077534,"Beta":1309703992022386183165993611366698039449427997366875639642677914951475221706823907699531135899378187345137248297716904194268204335922721510524184991509397615986404123812573854358437132930247316356255184788924935840515918099950130558424419903531643188876592420074187576524199587854261107593534067385965752399264845325260630893466709729776645784697678440777548173162016716442271527476508936523209308425504140835331887100060704271531181980383511620454596886380121860761894353523147348318148768028622355078055829353812198370994269990245609043478214679588655122686060531080442547691456489719416560149574599779497560540397,"P":75849894948976779735347811939983015358289701126129485530833575638336304057010228332753800003317076858576053749984240160808411262136532418035140646497137957027824646024782114246539581261706784164938926475111434750861757561016413917646100377165571797647126429477575305126842368487434225673773435238865330583191,"Q":81873382858150608270974344284366386586127885545529476425867785086174424391770284159998006978012455060242544956686506427859425032442988226529216027806950232752988031386429251427253121570173368239879150645596570395648059029809193584933987659800072813676205404224713952106143112830045808188056678954224735838871,"Xi":60512905083058102828317541363604535052000985569246545178344131423159529650473,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489042,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_3.json b/test/_ecdsa_fixtures/keygen_data_3.json new file mode 100644 index 00000000..c422830f --- /dev/null +++ b/test/_ecdsa_fixtures/keygen_data_3.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,"LambdaN":14749134019728161134791321632275369692524233013649779621809893296266483861419164743680072713641016673341420535980038784139535988273241282670491934117734071621260103564461008387216244962391506137562022368020062826970338541417071565123962100237373787684161492582175722302053952889270470318521461752951207663377582502103612481679785546903497737092646739718960228414265188637047734145789306900359930169567199430246932252502336754769449073545604399775563911963240361092178555640732059795193562526225136853498531215651426232467222597225811005278632409943793343072699662530148246780134904253559119203425983273951025936799894,"PhiN":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755165004207224963359571093806995474185293479437920456828530377274095468291578613800719860339134398860493864505004673509538898147091208799551127823926480722184357111281464119590387125052450273706997062431302852464934445194451622010557264819887586686145399325060296493560269808507118238406851966547902051873599788},"NTildei":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,"H1i":5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,"H2i":12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,"Alpha":11081657114302456905870238988700697319013086504514564717236045074111040270304721782262331797984252430691614068426017510955596726899195967257641174051208447703882084156250584889240095839005540489467495466401970938403346310247408556036689673665093871891298278435521624411505856307364696833164454575973504991622932285895551488556698850552346748171487933151897577939283303629805730794147946617342888218890447001725177619174876097488369727361791975676947593405865072809062942723273440763204434923600873531172534099494752733497463358209835051487344378604418153554063652737193195450363545532848418139118981255680730409512302,"Beta":6133618768796464642689127515841048603411678929048778887613183176733039223632781164469940532922927050017454407346388433982561059238874619156613764279538965805673999228182638980502231563434018778187561992484787389835733891936858821475338920262499782730107803586747101358654454935407337606947979613696034362388794178650615595301000673099802733126135747201458187852101946940145561403001819310752033044230595465371102376558670969498011525356932006598952421270622613251538649383121137336620394892312906550249450594313264381654471011359671967757794187070240886905186497395375837255241953831108789430500495617110587991996301,"P":84941379864152377210242225669264928317159691023194829254645679421740159925217588488952731004823868067983217061306123974421276127010516998676073136283299748376146263706853914037515593018335875604894543863897435289335816332576362867540441313891331099562100108503252946793135736355468080534347347538840570426873,"Q":86819486823245648518546333616113738580382590297427091187534930385584889538907177152831946012667038269320227368381411095041391216367702051211421278756687574403676284605154750830098843999500879487839364193328511641171985228555687462016996858882423932999028361743472217958832728717882760916905455608389887530339,"Xi":112364089429167805612617605207935992851480482276735837868384461499363971980649,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489043,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_4.json b/test/_ecdsa_fixtures/keygen_data_4.json new file mode 100644 index 00000000..18cb0d35 --- /dev/null +++ b/test/_ecdsa_fixtures/keygen_data_4.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909,"LambdaN":10149093216141134311501202950455404687819176108086655763439604876480308509005707752643443490458618682510036223990629323106173886175808296385044425686609452723084562797838400278366168111004894806650750910866618953798107499258689071481984957080631269921080772038916003912601845292072638787648449945124210960193914018453695854880781837335825176626684108716554580184283106556375591277128203617610174489949801946092341366958926118470264594116818761747017074162145794842957429280265435208677184352505170289174058848977955649818405678539344168643684878526539427706898487745565489565051297576919224296053356462767289289048302,"PhiN":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920387828036907391709761563674671650353253368217433109160368566213112751182554256407235220348979899603892184682733917852236940529188233637523494034148324291589685914858560530870417354368705010340578348117697955911299636811357078688337287369757053078855413796975491130979130102595153838448592106712925534578578096604},"NTildei":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909,"H1i":10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086,"H2i":10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921,"Alpha":8408470366230859983977089538380478977860826149489270454328069810654084975083526226901867967245101445604571410949184545806928848367496171695394490975680846096634659990572323984820874886556257679931369017546549426466636628349373434997535608357940850445740802672383001880942463774530857927596978058783287301574862650725916147886368087160144762544419662590752259939290502852152727675096647163487732198989142657556168211955697058551142360575384090048479907050673982511530357975733217486777543581646450398451190583984687224318655106759391236664029406648481857463190935034432818853948222748318559468062943056824704555449134,"Beta":1303581335756818709421881975179134242612051404487234919118951297997660912428946258874173450732466789964747275306227797921668519566246362883156545301727424652513857244895781110573586456845694327439680577390423603690354697165953336606634079302141662711178549256693383664872891160740523114376721120632255979366322575486090138921729381641635562008106350557695734541957078782962609079805469896014721289596075409223805019540244135461060563931165741325239147345553359517505411917435173817689525339060326714858182445353359473248514583063577451167780766715584898979803068848470341681729319284132561683099925112706032837788499,"P":70918676441702109847941825406161441598283607001708097764858825813492644009393784504292475652140532803920770131474422539758167085973762754473428906984187924773864860081926502586255610884224453115958082171309978978480769791086885257435170494368296494175633666482581964523282134040193158752887483912891606190001,"Q":71554446059664415649780061358007915967510424668040620898060829298683302856506794370674269725120058631352920707934286386144057997114398163450073057739596962373649591611826122138174635638077115626791220393282974257688218706979970561095686984927785021971551537923086586996462080307486196415763996110139649834151,"Xi":53183084676561391713014470804436785085880338239597555543583236211085867646018,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489044,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file From 872d9bc4b3c07b0df2994d2618b709d83f73c8bc Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Mon, 27 Dec 2021 15:28:55 -0500 Subject: [PATCH 05/33] Signing, EdDSA, Edwards: simplifying the references to the hashing algorithm. --- eddsa/signing/local_party.go | 32 ++++++++++++------------------- eddsa/signing/local_party_test.go | 8 ++------ eddsa/signing/round_1.go | 2 +- eddsa/signing/round_3.go | 3 ++- eddsa/signing/rounds.go | 2 +- 5 files changed, 18 insertions(+), 29 deletions(-) diff --git a/eddsa/signing/local_party.go b/eddsa/signing/local_party.go index 15713072..8097e3f8 100644 --- a/eddsa/signing/local_party.go +++ b/eddsa/signing/local_party.go @@ -9,7 +9,6 @@ package signing import ( "errors" "fmt" - "hash" "math/big" "github.com/binance-chain/tss-lib/common" @@ -24,17 +23,10 @@ import ( var _ tss.Party = (*LocalParty)(nil) var _ fmt.Stringer = (*LocalParty)(nil) -type HashingAlgorithm int - type ( - EdDSAParameters struct { - *tss.Parameters - HashingAlgorithm hash.Hash - } - LocalParty struct { *tss.BaseParty - edDSAParams *EdDSAParameters + params *tss.Parameters keys keygen.LocalPartySaveData temp localTempData @@ -73,20 +65,20 @@ type ( func NewLocalParty( msg *big.Int, - params *EdDSAParameters, + params *tss.Parameters, key keygen.LocalPartySaveData, out chan<- tss.Message, end chan<- common.SignatureData, ) tss.Party { partyCount := len(params.Parties().IDs()) p := &LocalParty{ - BaseParty: new(tss.BaseParty), - edDSAParams: params, - keys: keygen.BuildLocalSaveDataSubset(key, params.Parties().IDs()), - temp: localTempData{}, - data: common.SignatureData{}, - out: out, - end: end, + BaseParty: new(tss.BaseParty), + params: params, + keys: keygen.BuildLocalSaveDataSubset(key, params.Parties().IDs()), + temp: localTempData{}, + data: common.SignatureData{}, + out: out, + end: end, } // msgs init p.temp.signRound1Messages = make([]tss.ParsedMessage, partyCount) @@ -100,7 +92,7 @@ func NewLocalParty( } func (p *LocalParty) FirstRound() tss.Round { - return newRound1(p.edDSAParams, &p.keys, &p.data, &p.temp, p.out, p.end) + return newRound1(p.params, &p.keys, &p.data, &p.temp, p.out, p.end) } func (p *LocalParty) Start() *tss.Error { @@ -133,7 +125,7 @@ func (p *LocalParty) ValidateMessage(msg tss.ParsedMessage) (bool, *tss.Error) { return false, p.WrapError(fmt.Errorf("received msg with an invalid sender: %s", msg)) } // check that the message's "from index" will fit into the array - if maxFromIdx := len(p.edDSAParams.Parties().IDs()) - 1; maxFromIdx < msg.GetFrom().Index { + if maxFromIdx := len(p.params.Parties().IDs()) - 1; maxFromIdx < msg.GetFrom().Index { return false, p.WrapError(fmt.Errorf("received msg with a sender index too great (%d <= %d)", maxFromIdx, msg.GetFrom().Index), msg.GetFrom()) } @@ -167,7 +159,7 @@ func (p *LocalParty) StoreMessage(msg tss.ParsedMessage) (bool, *tss.Error) { } func (p *LocalParty) PartyID() *tss.PartyID { - return p.edDSAParams.PartyID() + return p.params.PartyID() } func (p *LocalParty) String() string { diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index 2d99cf96..a229d121 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -7,7 +7,6 @@ package signing import ( - "crypto/sha512" "encoding/hex" "fmt" "math/big" @@ -15,7 +14,6 @@ import ( "testing" "github.com/agl/ed25519/edwards25519" - "github.com/decred/dcrd/crypto/blake256" "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/decred/dcrd/dcrec/secp256k1/v2" "github.com/ipfs/go-log" @@ -67,8 +65,7 @@ func TestE2EConcurrentEdwards(t *testing.T) { for i := 0; i < len(signPIDs); i++ { params := tss.NewParameters(edwards.Edwards(), p2pCtx, signPIDs[i], len(signPIDs), threshold) - edDSAParameters := &EdDSAParameters{Parameters: params, HashingAlgorithm: sha512.New()} - P := NewLocalParty(msg, edDSAParameters, keys[i], outCh, endCh).(*LocalParty) + P := NewLocalParty(msg, params, keys[i], outCh, endCh).(*LocalParty) parties = append(parties, P) go func(P *LocalParty) { if err := P.Start(); err != nil { @@ -183,9 +180,8 @@ func TestE2EConcurrentS256Schnorr(t *testing.T) { // init the parties for i := 0; i < len(signPIDs); i++ { params := tss.NewParameters(tss.S256(), p2pCtx, signPIDs[i], len(signPIDs), threshold) - edDSAParameters := &EdDSAParameters{Parameters: params, HashingAlgorithm: blake256.New()} - P := NewLocalParty(msg, edDSAParameters, keys[i], outCh, endCh).(*LocalParty) + P := NewLocalParty(msg, params, keys[i], outCh, endCh).(*LocalParty) parties = append(parties, P) go func(P *LocalParty) { if err := P.Start(); err != nil { diff --git a/eddsa/signing/round_1.go b/eddsa/signing/round_1.go index 74ef64a0..e176da5a 100644 --- a/eddsa/signing/round_1.go +++ b/eddsa/signing/round_1.go @@ -23,7 +23,7 @@ var ( ) // round 1 represents round 1 of the signing part of the EDDSA TSS spec -func newRound1(params *EdDSAParameters, key *keygen.LocalPartySaveData, data *common.SignatureData, temp *localTempData, out chan<- tss.Message, end chan<- common.SignatureData) tss.Round { +func newRound1(params *tss.Parameters, key *keygen.LocalPartySaveData, data *common.SignatureData, temp *localTempData, out chan<- tss.Message, end chan<- common.SignatureData) tss.Round { return &round1{ &base{params, key, data, temp, out, end, make([]bool, len(params.Parties().IDs())), false, 1}} } diff --git a/eddsa/signing/round_3.go b/eddsa/signing/round_3.go index 5195b0a4..e2f1740e 100644 --- a/eddsa/signing/round_3.go +++ b/eddsa/signing/round_3.go @@ -7,6 +7,7 @@ package signing import ( + "crypto/sha512" "math/big" "strings" @@ -104,7 +105,7 @@ func (round *round3) Start() *tss.Error { var 𝜆 *chainhash.Hash var lambdaReduced [32]byte if isTwistedEdwardsCurve { - h := round.EdDSAParameters.HashingAlgorithm + h := sha512.New() h.Reset() h.Write(encodedR[:]) h.Write(encodedPubKey[:]) diff --git a/eddsa/signing/rounds.go b/eddsa/signing/rounds.go index 2c664148..4cb7c91b 100644 --- a/eddsa/signing/rounds.go +++ b/eddsa/signing/rounds.go @@ -18,7 +18,7 @@ const ( type ( base struct { - *EdDSAParameters + *tss.Parameters key *keygen.LocalPartySaveData data *common.SignatureData temp *localTempData From 8c87d477c6f4b912fb0896ee5424dab643a19ab3 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Mon, 27 Dec 2021 15:37:47 -0500 Subject: [PATCH 06/33] Resharing, EdDSA, Edwards: simplifying the references to the hashing algorithm. --- eddsa/resharing/local_party_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eddsa/resharing/local_party_test.go b/eddsa/resharing/local_party_test.go index bbf8b0a1..ef999f70 100644 --- a/eddsa/resharing/local_party_test.go +++ b/eddsa/resharing/local_party_test.go @@ -7,7 +7,6 @@ package resharing_test import ( - "crypto/sha512" "math/big" "sync/atomic" "testing" @@ -168,8 +167,7 @@ signing: for j, signPID := range signPIDs { params := tss.NewParameters(tss.Edwards(), signP2pCtx, signPID, len(signPIDs), newThreshold) - edDSAParameters := &signing.EdDSAParameters{Parameters: params, HashingAlgorithm: sha512.New()} - P := signing.NewLocalParty(big.NewInt(42), edDSAParameters, signKeys[j], signOutCh, signEndCh).(*signing.LocalParty) + P := signing.NewLocalParty(big.NewInt(42), params, signKeys[j], signOutCh, signEndCh).(*signing.LocalParty) signParties = append(signParties, P) go func(P *signing.LocalParty) { if err := P.Start(); err != nil { From 4c394d22dcc58f41545740a2e3e3cd7788e1cd6a Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Thu, 30 Dec 2021 08:57:46 -0500 Subject: [PATCH 07/33] Util functions for Schnorr signatures. --- crypto/ecpoint.go | 9 +++++++++ eddsa/signing/utils.go | 22 ++++++++++++++++++---- go.mod | 28 ++++++++++++++++++++-------- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/crypto/ecpoint.go b/crypto/ecpoint.go index 4a6fddc3..a8cfd99a 100644 --- a/crypto/ecpoint.go +++ b/crypto/ecpoint.go @@ -17,6 +17,7 @@ import ( "math/big" "github.com/binance-chain/tss-lib/tss" + "github.com/btcsuite/btcd/btcec/v2" ) // ECPoint convenience helper @@ -66,6 +67,14 @@ func (p *ECPoint) ToECDSAPubKey() *ecdsa.PublicKey { } } +func (p *ECPoint) ToBtcecPubKey() *btcec.PublicKey { + var x, y btcec.FieldVal + x.SetByteSlice(p.X().Bytes()) + y.SetByteSlice(p.Y().Bytes()) + + return btcec.NewPublicKey(&x, &y) +} + func (p *ECPoint) IsOnCurve() bool { return isOnCurve(p.curve, p.coords[0], p.coords[1]) } diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index c79bbccf..680531dd 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -135,13 +135,27 @@ func oddY(a *crypto.ECPoint) bool { } func SchnorrVerify(p *secp256k12.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { + signature := RSToSchnorrSignature(r_, s_) + var x, y btcec.FieldVal + x.SetByteSlice(p.X.Bytes()) + y.SetByteSlice(p.Y.Bytes()) + return signature.Verify(m, btcec.NewPublicKey(&x, &y)) +} + +func RSToSchnorrSignature(r_ *big.Int, s_ *big.Int) *schnorr.Signature { var r btcec.FieldVal var s btcec.ModNScalar r.SetByteSlice(r_.Bytes()) s.SetByteSlice(s_.Bytes()) signature := schnorr.NewSignature(&r, &s) - var x, y btcec.FieldVal - x.SetByteSlice(p.X.Bytes()) - y.SetByteSlice(p.Y.Bytes()) - return signature.Verify(m, btcec.NewPublicKey(&x, &y)) + return signature +} + +func RSByesToSchnorrSignature(r_ []byte, s_ []byte) *schnorr.Signature { + var r btcec.FieldVal + var s btcec.ModNScalar + r.SetByteSlice(r_) + s.SetByteSlice(s_) + signature := schnorr.NewSignature(&r, &s) + return signature } diff --git a/go.mod b/go.mod index 57071907..3365d76f 100644 --- a/go.mod +++ b/go.mod @@ -7,28 +7,40 @@ require ( github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcd/btcec/v2 v2.0.0-00010101000000-000000000000 github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd - github.com/decred/dcrd/crypto/blake256 v1.0.0 github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 github.com/golang/protobuf v1.5.2 - github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 github.com/ipfs/go-log v1.0.5 - github.com/ipfs/go-log/v2 v2.4.0 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/olekukonko/tablewriter v0.0.4 github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.7.0 + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 + golang.org/x/text v0.3.6 + google.golang.org/protobuf v1.27.1 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/chaincfg/chainhash v1.0.2 // indirect + github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/ipfs/go-log/v2 v2.4.0 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.7 // indirect + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.19.1 // indirect - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 // indirect - golang.org/x/text v0.3.6 - google.golang.org/protobuf v1.27.1 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) replace github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 From 581c172aae26d388903d73b0f708079a00e3102a Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Sun, 16 Jan 2022 11:49:36 -0500 Subject: [PATCH 08/33] Refactoring of Schnorr verification. No functional change. --- ecdsa/signing/ecdsa-signature.pb.go | 306 ------------------ eddsa/keygen/local_party_test.go | 21 +- eddsa/signing/eddsa-signature.pb.go | 158 --------- eddsa/signing/finalize.go | 11 +- eddsa/signing/local_party_test.go | 9 +- eddsa/signing/round_3.go | 3 +- eddsa/signing/utils.go | 208 +++++++++++- go.mod | 4 +- ...ure.proto => ecdsa-signature.proto.delete} | 2 +- ...ure.proto => eddsa-signature.proto.delete} | 2 +- test/_eddsa_fixtures/keygen_data_S256_0.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_1.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_2.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_3.json | 2 +- test/_eddsa_fixtures/keygen_data_S256_4.json | 2 +- 15 files changed, 229 insertions(+), 505 deletions(-) delete mode 100644 ecdsa/signing/ecdsa-signature.pb.go delete mode 100644 eddsa/signing/eddsa-signature.pb.go rename protob/{ecdsa-signature.proto => ecdsa-signature.proto.delete} (96%) rename protob/{eddsa-signature.proto => eddsa-signature.proto.delete} (93%) diff --git a/ecdsa/signing/ecdsa-signature.pb.go b/ecdsa/signing/ecdsa-signature.pb.go deleted file mode 100644 index 23baeca0..00000000 --- a/ecdsa/signing/ecdsa-signature.pb.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright © 2019 Binance -// -// This file is part of Binance. The full Binance copyright notice, including -// terms governing use, modification, and redistribution, is contained in the -// file LICENSE at the root of the source code distribution tree. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 -// source: protob/ecdsa-signature.proto - -package signing - -import ( - common "github.com/binance-chain/tss-lib/common" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// -// State object for signatures, either partial (for offline/async "one round" signing) or full (contains the final ECDSA signature). -type SignatureData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Signature *common.ECSignature `protobuf:"bytes,10,opt,name=signature,proto3" json:"signature,omitempty"` - OneRoundData *SignatureData_OneRoundData `protobuf:"bytes,11,opt,name=one_round_data,json=oneRoundData,proto3" json:"one_round_data,omitempty"` -} - -func (x *SignatureData) Reset() { - *x = SignatureData{} - if protoimpl.UnsafeEnabled { - mi := &file_protob_ecdsa_signature_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignatureData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignatureData) ProtoMessage() {} - -func (x *SignatureData) ProtoReflect() protoreflect.Message { - mi := &file_protob_ecdsa_signature_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignatureData.ProtoReflect.Descriptor instead. -func (*SignatureData) Descriptor() ([]byte, []int) { - return file_protob_ecdsa_signature_proto_rawDescGZIP(), []int{0} -} - -func (x *SignatureData) GetSignature() *common.ECSignature { - if x != nil { - return x.Signature - } - return nil -} - -func (x *SignatureData) GetOneRoundData() *SignatureData_OneRoundData { - if x != nil { - return x.OneRoundData - } - return nil -} - -type SignatureData_OneRoundData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Sanity check in FinalizeGetAndVerifyFinalSig - T int32 `protobuf:"varint,1,opt,name=t,proto3" json:"t,omitempty"` - // Components to produce s = sum(s_i) - KI []byte `protobuf:"bytes,2,opt,name=k_i,json=kI,proto3" json:"k_i,omitempty"` - RSigmaI []byte `protobuf:"bytes,3,opt,name=r_sigma_i,json=rSigmaI,proto3" json:"r_sigma_i,omitempty"` - BigR *common.ECPoint `protobuf:"bytes,4,opt,name=big_r,json=bigR,proto3" json:"big_r,omitempty"` - // Components for identifiable aborts during the final phase - BigRBarJ map[string]*common.ECPoint `protobuf:"bytes,5,rep,name=big_r_bar_j,json=bigRBarJ,proto3" json:"big_r_bar_j,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - BigSJ map[string]*common.ECPoint `protobuf:"bytes,6,rep,name=big_s_j,json=bigSJ,proto3" json:"big_s_j,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *SignatureData_OneRoundData) Reset() { - *x = SignatureData_OneRoundData{} - if protoimpl.UnsafeEnabled { - mi := &file_protob_ecdsa_signature_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignatureData_OneRoundData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignatureData_OneRoundData) ProtoMessage() {} - -func (x *SignatureData_OneRoundData) ProtoReflect() protoreflect.Message { - mi := &file_protob_ecdsa_signature_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignatureData_OneRoundData.ProtoReflect.Descriptor instead. -func (*SignatureData_OneRoundData) Descriptor() ([]byte, []int) { - return file_protob_ecdsa_signature_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *SignatureData_OneRoundData) GetT() int32 { - if x != nil { - return x.T - } - return 0 -} - -func (x *SignatureData_OneRoundData) GetKI() []byte { - if x != nil { - return x.KI - } - return nil -} - -func (x *SignatureData_OneRoundData) GetRSigmaI() []byte { - if x != nil { - return x.RSigmaI - } - return nil -} - -func (x *SignatureData_OneRoundData) GetBigR() *common.ECPoint { - if x != nil { - return x.BigR - } - return nil -} - -func (x *SignatureData_OneRoundData) GetBigRBarJ() map[string]*common.ECPoint { - if x != nil { - return x.BigRBarJ - } - return nil -} - -func (x *SignatureData_OneRoundData) GetBigSJ() map[string]*common.ECPoint { - if x != nil { - return x.BigSJ - } - return nil -} - -var File_protob_ecdsa_signature_proto protoreflect.FileDescriptor - -var file_protob_ecdsa_signature_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x2f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x2d, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xfe, 0x03, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x43, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x6f, 0x6e, 0x65, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x6f, 0x75, - 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x6f, 0x6e, 0x65, 0x52, 0x6f, 0x75, 0x6e, 0x64, - 0x44, 0x61, 0x74, 0x61, 0x1a, 0xfd, 0x02, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x52, 0x6f, 0x75, 0x6e, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0c, 0x0a, 0x01, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x01, 0x74, 0x12, 0x0f, 0x0a, 0x03, 0x6b, 0x5f, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x02, 0x6b, 0x49, 0x12, 0x1a, 0x0a, 0x09, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6d, 0x61, 0x5f, - 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x53, 0x69, 0x67, 0x6d, 0x61, 0x49, - 0x12, 0x1d, 0x0a, 0x05, 0x62, 0x69, 0x67, 0x5f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x45, 0x43, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x04, 0x62, 0x69, 0x67, 0x52, 0x12, - 0x48, 0x0a, 0x0b, 0x62, 0x69, 0x67, 0x5f, 0x72, 0x5f, 0x62, 0x61, 0x72, 0x5f, 0x6a, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x44, 0x61, 0x74, - 0x61, 0x2e, 0x42, 0x69, 0x67, 0x52, 0x42, 0x61, 0x72, 0x4a, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x08, 0x62, 0x69, 0x67, 0x52, 0x42, 0x61, 0x72, 0x4a, 0x12, 0x3e, 0x0a, 0x07, 0x62, 0x69, 0x67, - 0x5f, 0x73, 0x5f, 0x6a, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x6f, - 0x75, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x69, 0x67, 0x53, 0x4a, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x05, 0x62, 0x69, 0x67, 0x53, 0x4a, 0x1a, 0x45, 0x0a, 0x0d, 0x42, 0x69, 0x67, - 0x52, 0x42, 0x61, 0x72, 0x4a, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x43, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x42, 0x0a, 0x0a, 0x42, 0x69, 0x67, 0x53, 0x4a, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x1e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x45, 0x43, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x62, 0x69, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2f, 0x74, 0x73, 0x73, 0x2d, 0x6c, 0x69, 0x62, 0x2f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x2f, 0x73, - 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_protob_ecdsa_signature_proto_rawDescOnce sync.Once - file_protob_ecdsa_signature_proto_rawDescData = file_protob_ecdsa_signature_proto_rawDesc -) - -func file_protob_ecdsa_signature_proto_rawDescGZIP() []byte { - file_protob_ecdsa_signature_proto_rawDescOnce.Do(func() { - file_protob_ecdsa_signature_proto_rawDescData = protoimpl.X.CompressGZIP(file_protob_ecdsa_signature_proto_rawDescData) - }) - return file_protob_ecdsa_signature_proto_rawDescData -} - -var file_protob_ecdsa_signature_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_protob_ecdsa_signature_proto_goTypes = []interface{}{ - (*SignatureData)(nil), // 0: SignatureData - (*SignatureData_OneRoundData)(nil), // 1: SignatureData.OneRoundData - nil, // 2: SignatureData.OneRoundData.BigRBarJEntry - nil, // 3: SignatureData.OneRoundData.BigSJEntry - (*common.ECSignature)(nil), // 4: ECSignature - (*common.ECPoint)(nil), // 5: ECPoint -} -var file_protob_ecdsa_signature_proto_depIdxs = []int32{ - 4, // 0: SignatureData.signature:type_name -> ECSignature - 1, // 1: SignatureData.one_round_data:type_name -> SignatureData.OneRoundData - 5, // 2: SignatureData.OneRoundData.big_r:type_name -> ECPoint - 2, // 3: SignatureData.OneRoundData.big_r_bar_j:type_name -> SignatureData.OneRoundData.BigRBarJEntry - 3, // 4: SignatureData.OneRoundData.big_s_j:type_name -> SignatureData.OneRoundData.BigSJEntry - 5, // 5: SignatureData.OneRoundData.BigRBarJEntry.value:type_name -> ECPoint - 5, // 6: SignatureData.OneRoundData.BigSJEntry.value:type_name -> ECPoint - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_protob_ecdsa_signature_proto_init() } -func file_protob_ecdsa_signature_proto_init() { - if File_protob_ecdsa_signature_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_protob_ecdsa_signature_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignatureData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protob_ecdsa_signature_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignatureData_OneRoundData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_protob_ecdsa_signature_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_protob_ecdsa_signature_proto_goTypes, - DependencyIndexes: file_protob_ecdsa_signature_proto_depIdxs, - MessageInfos: file_protob_ecdsa_signature_proto_msgTypes, - }.Build() - File_protob_ecdsa_signature_proto = out.File - file_protob_ecdsa_signature_proto_rawDesc = nil - file_protob_ecdsa_signature_proto_goTypes = nil - file_protob_ecdsa_signature_proto_depIdxs = nil -} diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index d2b9288d..57d2e141 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -15,9 +15,10 @@ import ( "sync/atomic" "testing" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/decred/dcrd/dcrec/secp256k1/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v2/schnorr" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" @@ -311,9 +312,16 @@ keygen: assert.NoError(t, err, "vss.ReConstruct should not throw error") // uG test: u*G[j] == V[0] - assert.Equal(t, uj, Pj.temp.ui) + if eq := assert.Equal(t, uj, Pj.temp.ui); !eq { + t.Logf("Pj: %v, uj: %v, ui: %v", Pj, + common.FormatBigInt(uj), common.FormatBigInt(Pj.temp.ui)) + t.FailNow() + } uG := crypto.ScalarBaseMult(tss.S256(), uj) - assert.True(t, uG.Equals(Pj.temp.vs[0]), "ensure u*G[j] == V_0") + if eq := assert.Equal(t, uG, Pj.temp.vs[0], "ensure u*G[j] == V_0"); !eq { + t.Logf("Pj: %v", Pj) + t.FailNow() + } // xj tests: BigXj == xj*G xj := Pj.data.Xi @@ -346,7 +354,7 @@ keygen: Y: pkY, } println("u len: ", len(u.Bytes())) - sk, _ := secp256k1.PrivKeyFromScalar(u.Bytes()) + sk, _ := btcec.PrivKeyFromBytes(u.Bytes()) // fmt.Println("err: ", err.Error()) // test pub key, should be on curve and match pkX, pkY @@ -364,6 +372,7 @@ keygen: assert.Equal(t, pkX, Pj.data.EDDSAPub.X()) assert.Equal(t, pkY, Pj.data.EDDSAPub.Y()) } + t.Logf("Public key: X: %v, Y: %v", common.FormatBigInt(pkX), common.FormatBigInt(pkY)) t.Log("Public key distribution test done.") // test sign/verify @@ -371,9 +380,9 @@ keygen: for i := range data { data[i] = byte(i) } - r, s, err := schnorr.Sign(sk, data) + signature, err := schnorr.Sign(sk, data) assert.NoError(t, err, "sign should not throw an error") - ok := schnorr.Verify(&pk, data, r, s) + ok := signature.Verify(data, save.EDDSAPub.ToBtcecPubKey()) assert.True(t, ok, "signature should be ok") t.Log("EdDSA signing test done.") diff --git a/eddsa/signing/eddsa-signature.pb.go b/eddsa/signing/eddsa-signature.pb.go deleted file mode 100644 index ce282594..00000000 --- a/eddsa/signing/eddsa-signature.pb.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright © 2019 Binance -// -// This file is part of Binance. The full Binance copyright notice, including -// terms governing use, modification, and redistribution, is contained in the -// file LICENSE at the root of the source code distribution tree. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 -// source: protob/eddsa-signature.proto - -package signing - -import ( - common "github.com/binance-chain/tss-lib/common" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// -// State object for signatures, contains the final EdDSA signature. -type SignatureData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Signature *common.ECSignature `protobuf:"bytes,10,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *SignatureData) Reset() { - *x = SignatureData{} - if protoimpl.UnsafeEnabled { - mi := &file_protob_eddsa_signature_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignatureData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignatureData) ProtoMessage() {} - -func (x *SignatureData) ProtoReflect() protoreflect.Message { - mi := &file_protob_eddsa_signature_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignatureData.ProtoReflect.Descriptor instead. -func (*SignatureData) Descriptor() ([]byte, []int) { - return file_protob_eddsa_signature_proto_rawDescGZIP(), []int{0} -} - -func (x *SignatureData) GetSignature() *common.ECSignature { - if x != nil { - return x.Signature - } - return nil -} - -var File_protob_eddsa_signature_proto protoreflect.FileDescriptor - -var file_protob_eddsa_signature_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x2f, 0x65, 0x64, 0x64, 0x73, 0x61, 0x2d, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x43, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, - 0x69, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x74, 0x73, 0x73, - 0x2d, 0x6c, 0x69, 0x62, 0x2f, 0x65, 0x64, 0x64, 0x73, 0x61, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, - 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_protob_eddsa_signature_proto_rawDescOnce sync.Once - file_protob_eddsa_signature_proto_rawDescData = file_protob_eddsa_signature_proto_rawDesc -) - -func file_protob_eddsa_signature_proto_rawDescGZIP() []byte { - file_protob_eddsa_signature_proto_rawDescOnce.Do(func() { - file_protob_eddsa_signature_proto_rawDescData = protoimpl.X.CompressGZIP(file_protob_eddsa_signature_proto_rawDescData) - }) - return file_protob_eddsa_signature_proto_rawDescData -} - -var file_protob_eddsa_signature_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_protob_eddsa_signature_proto_goTypes = []interface{}{ - (*SignatureData)(nil), // 0: SignatureData - (*common.ECSignature)(nil), // 1: ECSignature -} -var file_protob_eddsa_signature_proto_depIdxs = []int32{ - 1, // 0: SignatureData.signature:type_name -> ECSignature - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_protob_eddsa_signature_proto_init() } -func file_protob_eddsa_signature_proto_init() { - if File_protob_eddsa_signature_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_protob_eddsa_signature_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignatureData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_protob_eddsa_signature_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_protob_eddsa_signature_proto_goTypes, - DependencyIndexes: file_protob_eddsa_signature_proto_depIdxs, - MessageInfos: file_protob_eddsa_signature_proto_msgTypes, - }.Build() - File_protob_eddsa_signature_proto = out.File - file_protob_eddsa_signature_proto_rawDesc = nil - file_protob_eddsa_signature_proto_goTypes = nil - file_protob_eddsa_signature_proto_depIdxs = nil -} diff --git a/eddsa/signing/finalize.go b/eddsa/signing/finalize.go index a48f27e1..9f4abab9 100644 --- a/eddsa/signing/finalize.go +++ b/eddsa/signing/finalize.go @@ -7,6 +7,7 @@ package signing import ( + "encoding/hex" "errors" "fmt" "math/big" @@ -16,7 +17,6 @@ import ( "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/tss" "github.com/decred/dcrd/dcrec/edwards/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v2" ) func (round *finalization) Start() *tss.Error { @@ -90,17 +90,14 @@ func (round *finalization) Start() *tss.Error { X: round.key.EDDSAPub.X(), Y: round.key.EDDSAPub.Y(), } + common.Logger.Debugf("finalize - r: %v, s:%v", hex.EncodeToString(round.temp.r.Bytes()), + hex.EncodeToString(s.Bytes())) ok = edwards.Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) if !ok { return round.WrapError(fmt.Errorf("edwards signature verification failed")) } } else if isSecp256k1Curve { - pk := secp256k1.PublicKey{ - Curve: round.Params().EC(), - X: round.key.EDDSAPub.X(), - Y: round.key.EDDSAPub.Y(), - } - ok = SchnorrVerify(&pk, round.temp.m.Bytes(), round.temp.r, s) + ok = SchnorrVerify(round.key.EDDSAPub.ToBtcecPubKey(), round.temp.m.Bytes(), round.temp.r, s) if !ok { return round.WrapError(fmt.Errorf("schnorr signature verification failed")) } diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index a229d121..c9366f14 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -15,7 +15,6 @@ import ( "github.com/agl/ed25519/edwards25519" "github.com/decred/dcrd/dcrec/edwards/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v2" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" @@ -233,17 +232,11 @@ signing: // END check s correctness // BEGIN EdDSA verify - pkX, pkY := keys[0].EDDSAPub.X(), keys[0].EDDSAPub.Y() - pk := secp256k1.PublicKey{ - Curve: tss.S256(), - X: pkX, - Y: pkY, - } r := new(big.Int).SetBytes(parties[0].data.GetR()) s := new(big.Int).SetBytes(parties[0].data.GetS()) - ok := SchnorrVerify(&pk, msg_, r, s) + ok := SchnorrVerify(keys[0].EDDSAPub.ToBtcecPubKey(), msg_, r, s) assert.True(t, ok, "eddsa verify must pass") t.Log("EdDSA signing test done.") diff --git a/eddsa/signing/round_3.go b/eddsa/signing/round_3.go index e2f1740e..71ba5729 100644 --- a/eddsa/signing/round_3.go +++ b/eddsa/signing/round_3.go @@ -12,6 +12,7 @@ import ( "strings" "github.com/agl/ed25519/edwards25519" + "github.com/binance-chain/tss-lib/common" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/decred/dcrd/dcrec/edwards/v2" @@ -117,7 +118,7 @@ func (round *round3) Start() *tss.Error { // if R has an odd Y coordinate, we'll add to it until we find an R with even Y. a := 0 G := crypto.ScalarBaseMult(round.Params().EC(), big.NewInt(1)) - for ; oddY(Rsecp256k1); a++ { // Y cannot be odd in BIP340 + for ; OddY(Rsecp256k1); a++ { // Y cannot be odd in BIP340 Rsecp256k1, _ = Rsecp256k1.Add(G) } round.temp.a = a diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index 680531dd..851312a1 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -8,6 +8,8 @@ package signing import ( "crypto/elliptic" + "encoding/hex" + "fmt" "math/big" "github.com/agl/ed25519/edwards25519" @@ -15,7 +17,8 @@ import ( "github.com/binance-chain/tss-lib/crypto" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" - secp256k12 "github.com/decred/dcrd/dcrec/secp256k1/v2" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/decred/dcrd/dcrec/secp256k1/v4" ) func encodedBytesToBigInt(s *[32]byte) *big.Int { @@ -130,16 +133,191 @@ func ecPointToExtendedElement(ec elliptic.Curve, x *big.Int, y *big.Int) edwards } } -func oddY(a *crypto.ECPoint) bool { +func OddY(a *crypto.ECPoint) bool { return a.Y().Bit(0) > 0 } -func SchnorrVerify(p *secp256k12.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { - signature := RSToSchnorrSignature(r_, s_) - var x, y btcec.FieldVal - x.SetByteSlice(p.X.Bytes()) - y.SetByteSlice(p.Y.Bytes()) - return signature.Verify(m, btcec.NewPublicKey(&x, &y)) +func SchnorrVerify(p *btcec.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { + var r btcec.FieldVal + var s btcec.ModNScalar + r.SetByteSlice(r_.Bytes()) + s.SetByteSlice(s_.Bytes()) + err := schnorrVerify(m, p, r, s) + return err == nil +} + +func schnorrVerify(hash []byte, pub *btcec.PublicKey, sigR btcec.FieldVal, sigS btcec.ModNScalar) error { + // The algorithm for producing a BIP-340 signature is described in + // README.md and is reproduced here for reference: + // + // 1. Fail if m is not 32 bytes + // 2. P = lift_x(int(pk)). + // 3. r = int(sig[0:32]); fail is r >= p. + // 4. s = int(sig[32:64]); fail if s >= n. + // 5. e = int(tagged_hash("BIP0340/challenge", bytes(r) || bytes(P) || M)) mod n. + // 6. R = s*G - e*P + // 7. Fail if is_infinite(R) + // 8. Fail if not hash_even_y(R) + // 9. Fail is x(R) != r. + // 10. Return success iff not failure occured before reachign this + // point. + + // Step 1. + // + // Fail if m is not 32 bytes + if len(hash) != 32 { + str := fmt.Sprintf("wrong size for message (got %v, want %v)", + len(hash), 32) + return schnorr.Error{Err: schnorr.ErrorKind("ErrInvalidHashLen"), Description: str} + } + + // Before we proceed, we want to ensure that the public key we're using + // for verification always has an even y-coordinate. So we'll serialize + // it, then parse it again to esure we only proceed with points that + // have an even y-coordinate. + pubKey, err := ParsePubKey(pub.SerializeCompressed()[1:]) + if err != nil { + return err + } + pubKey = pub // extra + + // Step 2. + // + // Fail if Q is not a point on the curve + if !pubKey.IsOnCurve() { + str := "pubkey point is not on curve" + return schnorr.Error{Err: schnorr.ErrorKind("ErrPubKeyNotOnCurve"), Description: str} + } + + // Step 3. + // + // Fail if r >= p + // + // Note this is already handled by the fact r is a field element. + + // Step 4. + // + // Fail if s >= n + // + // Note this is already handled by the fact s is a mod n scalar. + + // Step 5. + // + // e = int(tagged_hash("BIP0340/challenge", bytes(r) || bytes(P) || M)) mod n. + var rBytes [32]byte + sigR.PutBytesUnchecked(rBytes[:]) + pBytes := pubKey.SerializeCompressed() + + logBytes("finalize schnorrVerify - ", rBytes[:], pBytes[1:], hash) + common.Logger.Debugf("finalize schnorrVerify - sigR: %v", sigR.String()) + commitment := chainhash.TaggedHash( + []byte("BIP0340/challenge"), rBytes[:], pBytes[1:], hash, + ) + + var e btcec.ModNScalar + if overflow := e.SetBytes((*[32]byte)(commitment)); overflow != 0 { + str := "hash of (r || P || m) too big" + return schnorr.Error{Err: schnorr.ErrorKind("ErrSchnorrHashValue"), Description: str} + } + + common.Logger.Debugf("finalize schnorrVerify - e: %v", e.String()) + + // Negate e here so we can use AddNonConst below to subtract the s*G + // point from e*P. + e.Negate() + + // Step 6. + // + // R = s*G - e*P + var P, R, sG, eP btcec.JacobianPoint + pubKey.AsJacobian(&P) + btcec.ScalarBaseMultNonConst(&sigS, &sG) + btcec.ScalarMultNonConst(&e, &P, &eP) + + var _sGAffine btcec.JacobianPoint + _sGAffine.X, _sGAffine.Y, _sGAffine.Z = sG.X, sG.Y, sG.Z + _sGAffine.ToAffine() + + var _ePAffine btcec.JacobianPoint + _ePAffine.X, _ePAffine.Y, _ePAffine.Z = eP.X, eP.Y, eP.Z + _ePAffine.ToAffine() + common.Logger.Infof("finalize - (minus)e: %v, P: %v, _sGAffine: %v, -ePAffine: %v", e.String(), + JacobianPointToString(P), + JacobianPointToString(_sGAffine), + JacobianPointToString(_ePAffine)) + btcec.AddNonConst(&sG, &eP, &R) + + // Step 7. + // + // Fail if R is the point at infinity + if (R.X.IsZero() && R.Y.IsZero()) || R.Z.IsZero() { + str := "calculated R point is the point at infinity" + return schnorr.Error{Err: schnorr.ErrorKind("ErrSigRNotOnCurve"), Description: str} + } + + // Step 8. + // + // Fail if R.y is odd + // + // Note that R must be in affine coordinates for this check. + R.ToAffine() + common.Logger.Debugf("finalize - R (calculated) (after affine): %v", JacobianPointToString(R)) + if R.Y.IsOdd() { + str := "calculated R y-value is odd" + return schnorr.Error{Err: schnorr.ErrorKind("ErrSigRYIsOdd"), Description: str} + } + + // Step 9. + // + // Verified if R.x == r + // + // Note that R must be in affine coordinates for this check. + common.Logger.Debugf("sigR: %s, R.X (calculated): %s", sigR.String(), R.X.String()) + if !sigR.Equals(&R.X) { + str := "calculated R point was not given R" + return schnorr.Error{Err: schnorr.ErrorKind("ErrUnequalRValues"), Description: str} + } + + // Step 10. + // + // Return success iff not failure occured before reachign this + return nil +} + +func logBytes(logMsg string, r, p, h []byte) { + common.Logger.Debugf("%s r: %s, p: %s, h: %s", logMsg, hex.EncodeToString(r), hex.EncodeToString(p), hex.EncodeToString(h)) +} + +func JacobianPointToString(point secp256k1.JacobianPoint) string { + return "[X:" + point.X.String() + ", Y:" + point.Y.String() + ", Z:" + point.Z.String() + "]" +} + +func ParsePubKey(pubKeyStr []byte) (*btcec.PublicKey, error) { + if pubKeyStr == nil { + err := fmt.Errorf("nil pubkey byte string") + return nil, err + } + if len(pubKeyStr) != 32 { + err := fmt.Errorf("bad pubkey byte string size (want %v, have %v)", + 32, len(pubKeyStr)) + return nil, err + } + + // We'll manually prepend the compressed byte so we can re-use the + // existing pubkey parsing routine of the main btcec package. + var keyCompressed [btcec.PubKeyBytesLenCompressed]byte + keyCompressed[0] = btcec.PubKeyFormatCompressedEven + copy(keyCompressed[1:], pubKeyStr) + + return btcec.ParsePubKey(keyCompressed[:]) +} + +func RSBytesToBtcec(r_ []byte, s_ []byte) (btcec.FieldVal, btcec.ModNScalar) { + var r btcec.FieldVal + var s btcec.ModNScalar + r.SetByteSlice(r_) + s.SetByteSlice(s_) + return r, s } func RSToSchnorrSignature(r_ *big.Int, s_ *big.Int) *schnorr.Signature { @@ -156,6 +334,16 @@ func RSByesToSchnorrSignature(r_ []byte, s_ []byte) *schnorr.Signature { var s btcec.ModNScalar r.SetByteSlice(r_) s.SetByteSlice(s_) - signature := schnorr.NewSignature(&r, &s) - return signature + return schnorr.NewSignature(&r, &s) +} + +func NextPointEvenY(curve elliptic.Curve, P *crypto.ECPoint) (*crypto.ECPoint, int) { + G := crypto.ScalarBaseMult(curve, big.NewInt(1)) + a := 0 + Q := *P + Qptr := &Q + for ; OddY(Qptr); a++ { // Y cannot be odd + Qptr, _ = Qptr.Add(G) + } + return Qptr, a } diff --git a/go.mod b/go.mod index 3365d76f..5c9fd548 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,13 @@ module github.com/binance-chain/tss-lib go 1.17 require ( - github.com/agl/ed25519 v0.0.0-20200225211852-fd4d107ace12 + github.com/agl/ed25519 v0.0.0-20200305024217-f36fc4b53d43 github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcd/btcec/v2 v2.0.0-00010101000000-000000000000 github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 github.com/golang/protobuf v1.5.2 github.com/hashicorp/go-multierror v1.1.1 github.com/ipfs/go-log v1.0.5 @@ -25,7 +26,6 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/chaincfg/chainhash v1.0.2 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/ipfs/go-log/v2 v2.4.0 // indirect diff --git a/protob/ecdsa-signature.proto b/protob/ecdsa-signature.proto.delete similarity index 96% rename from protob/ecdsa-signature.proto rename to protob/ecdsa-signature.proto.delete index 5168af83..996be745 100644 --- a/protob/ecdsa-signature.proto +++ b/protob/ecdsa-signature.proto.delete @@ -5,7 +5,7 @@ // file LICENSE at the root of the source code distribution tree. syntax = "proto3"; - +package binance.tsslib.ecdsa.signing; option go_package = "github.com/binance-chain/tss-lib/ecdsa/signing"; import "protob/shared.proto"; diff --git a/protob/eddsa-signature.proto b/protob/eddsa-signature.proto.delete similarity index 93% rename from protob/eddsa-signature.proto rename to protob/eddsa-signature.proto.delete index 72b86942..1c215f94 100644 --- a/protob/eddsa-signature.proto +++ b/protob/eddsa-signature.proto.delete @@ -5,7 +5,7 @@ // file LICENSE at the root of the source code distribution tree. syntax = "proto3"; - +package binance.tsslib.eddsa.signing; option go_package = "github.com/binance-chain/tss-lib/eddsa/signing"; import "protob/shared.proto"; diff --git a/test/_eddsa_fixtures/keygen_data_S256_0.json b/test/_eddsa_fixtures/keygen_data_S256_0.json index 728fff4f..8a2214e1 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_0.json +++ b/test/_eddsa_fixtures/keygen_data_S256_0.json @@ -1 +1 @@ -{"Xi":42741719578003277110582513504028795704694674906236788659488762645533730839619,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161732,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file +{"Xi":36356306466761377653043531869380763147764809259286290231952243620647992665401,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923031,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_1.json b/test/_eddsa_fixtures/keygen_data_S256_1.json index b3e8f862..14ab9aad 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_1.json +++ b/test/_eddsa_fixtures/keygen_data_S256_1.json @@ -1 +1 @@ -{"Xi":59608870410834845924306616907593500926448036944113633360241219791171723219726,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161733,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file +{"Xi":6285294431335926611510652419499636672688217546979244226495132049262495974204,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923032,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_2.json b/test/_eddsa_fixtures/keygen_data_S256_2.json index 069619f6..70c3458e 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_2.json +++ b/test/_eddsa_fixtures/keygen_data_S256_2.json @@ -1 +1 @@ -{"Xi":2401696278359958102346236097539528009776582051381760491570827131962171137087,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161734,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file +{"Xi":93427477359914264470005838856114957964432074204607935278895437010562654215987,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923033,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_3.json b/test/_eddsa_fixtures/keygen_data_S256_3.json index 8f296d68..e3a8304b 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_3.json +++ b/test/_eddsa_fixtures/keygen_data_S256_3.json @@ -1 +1 @@ -{"Xi":102704375655211004491843341091242692660355438786190978818687910950941397580376,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161735,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file +{"Xi":66198676777864000381387121161850911317321250674022554623942832221512144402076,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923034,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_4.json b/test/_eddsa_fixtures/keygen_data_S256_4.json index 2a4083b0..6d5d8890 100644 --- a/test/_eddsa_fixtures/keygen_data_S256_4.json +++ b/test/_eddsa_fixtures/keygen_data_S256_4.json @@ -1 +1 @@ -{"Xi":13140640829439398822084976862639271319671914311316575193776981823554918066582,"ShareID":67462045749327339981807623895103747521521446472873582158858167505559615161736,"Ks":[67462045749327339981807623895103747521521446472873582158858167505559615161732,67462045749327339981807623895103747521521446472873582158858167505559615161733,67462045749327339981807623895103747521521446472873582158858167505559615161734,67462045749327339981807623895103747521521446472873582158858167505559615161735,67462045749327339981807623895103747521521446472873582158858167505559615161736],"BigXj":[{"Curve":"secp256k1","Coords":[39175686756937765350827891904732428173948047352885547120641232677681667394104,73973053553788819295544785029235678796979434034994130095979096490841414143172]},{"Curve":"secp256k1","Coords":[53962618400572133353262350535154356074935930687754493675613294460840622864995,16937782700639757696047291739403209112247735707786614002793778110907323239066]},{"Curve":"secp256k1","Coords":[66936373641994720411199017847271343161739128541402382156662298933325640269038,70689913518221010162103887859681089220302169873169527939900182119857143819785]},{"Curve":"secp256k1","Coords":[1824599427033748581959904440628171021138676772690884984493848736496455523766,68742805561845167970256835026906582427445627079846988812160010662286635211201]},{"Curve":"secp256k1","Coords":[76283175357733077480724435228647433795654945016004632822240283010658718586700,76781339627241749688345772415172633678795725746286580382505982862182673629408]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[51825256098878149490926093162980795878404541351926280388285913710661912663504,47523734179708479748125405485038477773365649626139234371749053177864739335294]}} \ No newline at end of file +{"Xi":40390981922501329769225484345395404584193311234298006644242480823629128026808,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923035,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file From a1c6f726a85dcc135bdb719aed2add66229f24a5 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Sun, 16 Jan 2022 11:55:30 -0500 Subject: [PATCH 09/33] Fixing import not used. --- eddsa/signing/round_3.go | 1 - 1 file changed, 1 deletion(-) diff --git a/eddsa/signing/round_3.go b/eddsa/signing/round_3.go index 71ba5729..99977f6b 100644 --- a/eddsa/signing/round_3.go +++ b/eddsa/signing/round_3.go @@ -12,7 +12,6 @@ import ( "strings" "github.com/agl/ed25519/edwards25519" - "github.com/binance-chain/tss-lib/common" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/decred/dcrd/dcrec/edwards/v2" From ba2ecfaba6c324ed8f23097e09adac7b840883b6 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Wed, 19 Jan 2022 20:11:26 -0500 Subject: [PATCH 10/33] Minor change: ECDSA signing task name. No functional change. --- ecdsa/signing/rounds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecdsa/signing/rounds.go b/ecdsa/signing/rounds.go index 36405c34..c6167086 100644 --- a/ecdsa/signing/rounds.go +++ b/ecdsa/signing/rounds.go @@ -13,7 +13,7 @@ import ( ) const ( - TaskName = "signing" + TaskName = "ecdsa-signing" ) type ( From 64ca29cf091c7d940b257b7c55741a9a569f103d Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Wed, 26 Jan 2022 07:27:11 -0500 Subject: [PATCH 11/33] No functional change (force push) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2ea214b5..ab61fa15 100644 --- a/README.md +++ b/README.md @@ -171,4 +171,3 @@ A full review of this library was carried out by Kudelski Security and their fin ## References \[1\] https://eprint.iacr.org/2020/540.pdf - From 21ad11806da3d2e74605dd5dbb663b82e40cea84 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Wed, 26 Jan 2022 16:15:36 -0500 Subject: [PATCH 12/33] Various changes matching an external repo. Adding elliptic curve as parameter to functions. Updating the protobuf import package. --- Makefile | 26 +++++++++++++--- crypto/ecpoint.go | 5 ++++ crypto/mta/proofs.go | 30 +++++++++---------- crypto/mta/range_proof.go | 23 +++++++------- crypto/mta/range_proof_test.go | 45 ++++++++++++++++++++++++++++ crypto/mta/share_protocol.go | 27 ++++++++++------- crypto/mta/share_protocol_test.go | 12 ++++---- ecdsa/keygen/local_party_test.go | 9 ++++-- ecdsa/keygen/round_1.go | 2 +- ecdsa/signing/key_derivation_test.go | 6 ++-- ecdsa/signing/local_party_test.go | 4 +-- eddsa/resharing/messages.go | 1 + eddsa/signing/local_party_test.go | 9 ++++-- eddsa/signing/utils.go | 2 +- tss/message.go | 6 ++-- tss/wire.go | 22 +++++--------- 16 files changed, 151 insertions(+), 78 deletions(-) create mode 100644 crypto/mta/range_proof_test.go diff --git a/Makefile b/Makefile index 021f0465..b6757f34 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ MODULE = github.com/binance-chain/tss-lib PACKAGES = $(shell go list ./... | grep -v '/vendor/') +UT_PACKAGES_LEVEL_0 = $(shell go list ./... | grep -v '/vendor/' | grep 'keygen' ) +UT_PACKAGES_LEVEL_1 = $(shell go list ./... | grep -v '/vendor/' | grep -v 'keygen' ) all: protob test @@ -37,16 +39,32 @@ benchsign: fmt ######################################## ### Testing -test_unit: - @echo "--> Running Unit Tests" +test_unit_level0: + @echo "--> Running Unit Tests - Level 0" @echo "!!! WARNING: This will take a long time :)" - go test -timeout 60m $(PACKAGES) + @echo "!!! WARNING: This will delete fixtures :(" + sleep 10 + go clean -testcache + rm -f ./test/_ecdsa_fixtures/*json + rm -f ./test/_eddsa_fixtures/*json + go test -v -timeout 30m $(UT_PACKAGES_LEVEL_0) + + +test_unit: test_unit_level0 + @echo "--> Running Unit Tests - Level 1" + @echo "!!! WARNING: This will take a long time :)" + sleep 2 + go test -v -timeout 60m $(UT_PACKAGES_LEVEL_1) test_unit_race: @echo "--> Running Unit Tests (with Race Detection)" @echo "!!! WARNING: This will take a long time :)" + @echo "!!! WARNING: This will delete fixtures :(" # go clean -testcache - go test -timeout 60m -race $(PACKAGES) + sleep 10 + rm -f ./test/_ecdsa_fixtures/*json + rm -f ./test/_eddsa_fixtures/*json + go test -v -timeout 10m -race $(DEPENDENCIES_PACKAGES) test: make test_unit_race diff --git a/crypto/ecpoint.go b/crypto/ecpoint.go index a8cfd99a..c642f74a 100644 --- a/crypto/ecpoint.go +++ b/crypto/ecpoint.go @@ -99,6 +99,11 @@ func (p *ECPoint) ValidateBasic() bool { return p != nil && p.coords[0] != nil && p.coords[1] != nil && p.IsOnCurve() } +/* func (p *ECPoint) EightInvEight() *ECPoint { + return p.ScalarMult(eight).ScalarMult(eightInv) +} +*/ + func ScalarBaseMult(curve elliptic.Curve, k *big.Int) *ECPoint { x, y := curve.ScalarBaseMult(k.Bytes()) p, _ := NewECPoint(curve, x, y) // it must be on the curve, no need to check. diff --git a/crypto/mta/proofs.go b/crypto/mta/proofs.go index cab949a5..b2fdf15d 100644 --- a/crypto/mta/proofs.go +++ b/crypto/mta/proofs.go @@ -7,6 +7,7 @@ package mta import ( + "crypto/elliptic" "errors" "fmt" "math/big" @@ -14,7 +15,6 @@ import ( "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" "github.com/binance-chain/tss-lib/crypto/paillier" - "github.com/binance-chain/tss-lib/tss" ) const ( @@ -35,14 +35,14 @@ type ( // ProveBobWC implements Bob's proof both with or without check "ProveMtawc_Bob" and "ProveMta_Bob" used in the MtA protocol from GG18Spec (9) Figs. 10 & 11. // an absent `X` generates the proof without the X consistency check X = g^x -func ProveBobWC(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int, X *crypto.ECPoint) (*ProofBobWC, error) { +func ProveBobWC(ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int, X *crypto.ECPoint) (*ProofBobWC, error) { if pk == nil || NTilde == nil || h1 == nil || h2 == nil || c1 == nil || c2 == nil || x == nil || y == nil || r == nil { return nil, errors.New("ProveBob() received a nil argument") } NSq := pk.NSquare() - q := tss.EC().Params().N + q := ec.Params().N q3 := new(big.Int).Mul(q, q) q3.Mul(q3, q) qNTilde := new(big.Int).Mul(q, NTilde) @@ -65,9 +65,9 @@ func ProveBobWC(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int gamma := common.GetRandomPositiveRelativelyPrimeInt(pk.N) // 5. - u := crypto.NewECPointNoCurveCheck(tss.EC(), zero, zero) // initialization suppresses an IDE warning + u := crypto.NewECPointNoCurveCheck(ec, zero, zero) // initialization suppresses an IDE warning if X != nil { - u = crypto.ScalarBaseMult(tss.EC(), alpha) + u = crypto.ScalarBaseMult(ec, alpha) } // 6. @@ -135,22 +135,22 @@ func ProveBobWC(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int } // ProveBob implements Bob's proof "ProveMta_Bob" used in the MtA protocol from GG18Spec (9) Fig. 11. -func ProveBob(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int) (*ProofBob, error) { +func ProveBob(ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int) (*ProofBob, error) { // the Bob proof ("with check") contains the ProofBob "without check"; this method extracts and returns it // X is supplied as nil to exclude it from the proof hash - pf, err := ProveBobWC(pk, NTilde, h1, h2, c1, c2, x, y, r, nil) + pf, err := ProveBobWC(ec, pk, NTilde, h1, h2, c1, c2, x, y, r, nil) if err != nil { return nil, err } return pf.ProofBob, nil } -func ProofBobWCFromBytes(bzs [][]byte) (*ProofBobWC, error) { +func ProofBobWCFromBytes(ec elliptic.Curve, bzs [][]byte) (*ProofBobWC, error) { proofBob, err := ProofBobFromBytes(bzs) if err != nil { return nil, err } - point, err := crypto.NewECPoint(tss.EC(), + point, err := crypto.NewECPoint(ec, new(big.Int).SetBytes(bzs[10]), new(big.Int).SetBytes(bzs[11])) if err != nil { @@ -185,12 +185,12 @@ func ProofBobFromBytes(bzs [][]byte) (*ProofBob, error) { // ProveBobWC.Verify implements verification of Bob's proof with check "VerifyMtawc_Bob" used in the MtA protocol from GG18Spec (9) Fig. 10. // an absent `X` verifies a proof generated without the X consistency check X = g^x -func (pf *ProofBobWC) Verify(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big.Int, X *crypto.ECPoint) bool { +func (pf *ProofBobWC) Verify(ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big.Int, X *crypto.ECPoint) bool { if pk == nil || NTilde == nil || h1 == nil || h2 == nil || c1 == nil || c2 == nil { return false } - q := tss.EC().Params().N + q := ec.Params().N q3 := new(big.Int).Mul(q, q) q3.Mul(q3, q) @@ -216,8 +216,8 @@ func (pf *ProofBobWC) Verify(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big // 4. runs only in the "with check" mode from Fig. 10 if X != nil { - s1ModQ := new(big.Int).Mod(pf.S1, tss.EC().Params().N) - gS1 := crypto.ScalarBaseMult(tss.EC(), s1ModQ) + s1ModQ := new(big.Int).Mod(pf.S1, ec.Params().N) + gS1 := crypto.ScalarBaseMult(ec, s1ModQ) xEU, err := X.ScalarMult(e).Add(pf.U) if err != nil || !gS1.Equals(xEU) { return false @@ -268,12 +268,12 @@ func (pf *ProofBobWC) Verify(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big } // ProveBob.Verify implements verification of Bob's proof without check "VerifyMta_Bob" used in the MtA protocol from GG18Spec (9) Fig. 11. -func (pf *ProofBob) Verify(pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big.Int) bool { +func (pf *ProofBob) Verify(ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big.Int) bool { if pf == nil { return false } pfWC := &ProofBobWC{ProofBob: pf, U: nil} - return pfWC.Verify(pk, NTilde, h1, h2, c1, c2, nil) + return pfWC.Verify(ec, pk, NTilde, h1, h2, c1, c2, nil) } func (pf *ProofBob) ValidateBasic() bool { diff --git a/crypto/mta/range_proof.go b/crypto/mta/range_proof.go index 9ef2fa00..f02d57a7 100644 --- a/crypto/mta/range_proof.go +++ b/crypto/mta/range_proof.go @@ -7,13 +7,13 @@ package mta import ( + "crypto/elliptic" "errors" "fmt" "math/big" "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto/paillier" - "github.com/binance-chain/tss-lib/tss" ) const ( @@ -31,12 +31,12 @@ type ( ) // ProveRangeAlice implements Alice's range proof used in the MtA and MtAwc protocols from GG18Spec (9) Fig. 9. -func ProveRangeAlice(pk *paillier.PublicKey, c, NTilde, h1, h2, m, r *big.Int) (*RangeProofAlice, error) { +func ProveRangeAlice(ec elliptic.Curve, pk *paillier.PublicKey, c, NTilde, h1, h2, m, r *big.Int) (*RangeProofAlice, error) { if pk == nil || NTilde == nil || h1 == nil || h2 == nil || c == nil || m == nil || r == nil { return nil, errors.New("ProveRangeAlice constructor received nil value(s)") } - q := tss.EC().Params().N + q := ec.Params().N q3 := new(big.Int).Mul(q, q) q3.Mul(q3, q) qNTilde := new(big.Int).Mul(q, NTilde) @@ -103,13 +103,12 @@ func RangeProofAliceFromBytes(bzs [][]byte) (*RangeProofAlice, error) { }, nil } -func (pf *RangeProofAlice) Verify(pk *paillier.PublicKey, NTilde, h1, h2, c *big.Int) bool { +func (pf *RangeProofAlice) Verify(ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c *big.Int) bool { if pf == nil || !pf.ValidateBasic() || pk == nil || NTilde == nil || h1 == nil || h2 == nil || c == nil { return false } - NSq := new(big.Int).Mul(pk.N, pk.N) - q := tss.EC().Params().N + q := ec.Params().N q3 := new(big.Int).Mul(q, q) q3.Mul(q3, q) @@ -129,14 +128,14 @@ func (pf *RangeProofAlice) Verify(pk *paillier.PublicKey, NTilde, h1, h2, c *big minusE := new(big.Int).Sub(zero, e) { // 4. gamma^s_1 * s^N * c^-e - modNSq := common.ModInt(NSq) + modNSquared := common.ModInt(pk.NSquare()) - cExpMinusE := modNSq.Exp(c, minusE) - sExpN := modNSq.Exp(pf.S, pk.N) - gammaExpS1 := modNSq.Exp(pk.Gamma(), pf.S1) + cExpMinusE := modNSquared.Exp(c, minusE) + sExpN := modNSquared.Exp(pf.S, pk.N) + gammaExpS1 := modNSquared.Exp(pk.Gamma(), pf.S1) // u != (4) - products = modNSq.Mul(gammaExpS1, sExpN) - products = modNSq.Mul(products, cExpMinusE) + products = modNSquared.Mul(gammaExpS1, sExpN) + products = modNSquared.Mul(products, cExpMinusE) if pf.U.Cmp(products) != 0 { return false } diff --git a/crypto/mta/range_proof_test.go b/crypto/mta/range_proof_test.go new file mode 100644 index 00000000..3e44394e --- /dev/null +++ b/crypto/mta/range_proof_test.go @@ -0,0 +1,45 @@ +// Copyright © 2019 Binance +// +// This file is part of Binance. The full Binance copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +package mta + +import ( + "math/big" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/binance-chain/tss-lib/common" + "github.com/binance-chain/tss-lib/crypto" + "github.com/binance-chain/tss-lib/crypto/paillier" + "github.com/binance-chain/tss-lib/tss" +) + +// Using a modulus length of 2048 is recommended in the GG18 spec +const ( + testSafePrimeBits = 1024 +) + +func TestProveRangeAlice(t *testing.T) { + q := tss.EC().Params().N + + sk, pk, err := paillier.GenerateKeyPair(testPaillierKeyLength, 10*time.Minute) + assert.NoError(t, err) + + m := common.GetRandomPositiveInt(q) + c, r, err := sk.EncryptAndReturnRandomness(m) + assert.NoError(t, err) + + primes := [2]*big.Int{common.GetRandomPrimeInt(testSafePrimeBits), common.GetRandomPrimeInt(testSafePrimeBits)} + NTildei, h1i, h2i, err := crypto.GenerateNTildei(primes) + assert.NoError(t, err) + proof, err := ProveRangeAlice(tss.EC(), pk, c, NTildei, h1i, h2i, m, r) + assert.NoError(t, err) + + ok := proof.Verify(tss.EC(), pk, NTildei, h1i, h2i, c) + assert.True(t, ok, "proof must verify") +} diff --git a/crypto/mta/share_protocol.go b/crypto/mta/share_protocol.go index 18ec99f3..f66aa485 100644 --- a/crypto/mta/share_protocol.go +++ b/crypto/mta/share_protocol.go @@ -7,32 +7,34 @@ package mta import ( + "crypto/elliptic" "errors" "math/big" "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" "github.com/binance-chain/tss-lib/crypto/paillier" - "github.com/binance-chain/tss-lib/tss" ) func AliceInit( + ec elliptic.Curve, pkA *paillier.PublicKey, a, cA, rA, NTildeB, h1B, h2B *big.Int, ) (pf *RangeProofAlice, err error) { - return ProveRangeAlice(pkA, cA, NTildeB, h1B, h2B, a, rA) + return ProveRangeAlice(ec, pkA, cA, NTildeB, h1B, h2B, a, rA) } func BobMid( + ec elliptic.Curve, pkA *paillier.PublicKey, pf *RangeProofAlice, b, cA, NTildeA, h1A, h2A, NTildeB, h1B, h2B *big.Int, ) (beta, cB, betaPrm *big.Int, piB *ProofBob, err error) { - if !pf.Verify(pkA, NTildeB, h1B, h2B, cA) { + if !pf.Verify(ec, pkA, NTildeB, h1B, h2B, cA) { err = errors.New("RangeProofAlice.Verify() returned false") return } - q := tss.EC().Params().N + q := ec.Params().N betaPrm = common.GetRandomPositiveInt(pkA.N) cBetaPrm, cRand, err := pkA.EncryptAndReturnRandomness(betaPrm) if err != nil { @@ -45,17 +47,18 @@ func BobMid( return } beta = common.ModInt(q).Sub(zero, betaPrm) - piB, err = ProveBob(pkA, NTildeA, h1A, h2A, cA, cB, b, betaPrm, cRand) + piB, err = ProveBob(ec, pkA, NTildeA, h1A, h2A, cA, cB, b, betaPrm, cRand) return } func BobMidWC( + ec elliptic.Curve, pkA *paillier.PublicKey, pf *RangeProofAlice, b, cA, NTildeA, h1A, h2A, NTildeB, h1B, h2B *big.Int, B *crypto.ECPoint, ) (betaPrm, cB *big.Int, piB *ProofBobWC, err error) { - if !pf.Verify(pkA, NTildeB, h1B, h2B, cA) { + if !pf.Verify(ec, pkA, NTildeB, h1B, h2B, cA) { err = errors.New("RangeProofAlice.Verify() returned false") return } @@ -72,43 +75,45 @@ func BobMidWC( if err != nil { return } - piB, err = ProveBobWC(pkA, NTildeA, h1A, h2A, cA, cB, b, betaPrm, cRand, B) + piB, err = ProveBobWC(ec, pkA, NTildeA, h1A, h2A, cA, cB, b, betaPrm, cRand, B) return } func AliceEnd( + ec elliptic.Curve, pkA *paillier.PublicKey, pf *ProofBob, h1A, h2A, cA, cB, NTildeA *big.Int, sk *paillier.PrivateKey, ) (alphaIJ *big.Int, err error) { - if !pf.Verify(pkA, NTildeA, h1A, h2A, cA, cB) { + if !pf.Verify(ec, pkA, NTildeA, h1A, h2A, cA, cB) { err = errors.New("ProofBob.Verify() returned false") return } if alphaIJ, err = sk.Decrypt(cB); err != nil { return } - q := tss.EC().Params().N + q := ec.Params().N alphaIJ.Mod(alphaIJ, q) return } func AliceEndWC( + ec elliptic.Curve, pkA *paillier.PublicKey, pf *ProofBobWC, B *crypto.ECPoint, cA, cB, NTildeA, h1A, h2A *big.Int, sk *paillier.PrivateKey, ) (muIJ, muIJRec, muIJRand *big.Int, err error) { - if !pf.Verify(pkA, NTildeA, h1A, h2A, cA, cB, B) { + if !pf.Verify(ec, pkA, NTildeA, h1A, h2A, cA, cB, B) { err = errors.New("ProofBobWC.Verify() returned false") return } if muIJRec, muIJRand, err = sk.DecryptAndRecoverRandomness(cB); err != nil { return } - q := tss.EC().Params().N + q := ec.Params().N muIJ = new(big.Int).Mod(muIJRec, q) return } diff --git a/crypto/mta/share_protocol_test.go b/crypto/mta/share_protocol_test.go index 5c3660c4..4f9ca063 100644 --- a/crypto/mta/share_protocol_test.go +++ b/crypto/mta/share_protocol_test.go @@ -41,13 +41,13 @@ func TestShareProtocol(t *testing.T) { cA, rA, err := pk.EncryptAndReturnRandomness(a) assert.NoError(t, err) - pf, err := AliceInit(pk, a, cA, rA, NTildej, h1j, h2j) + pf, err := AliceInit(tss.EC(), pk, a, cA, rA, NTildej, h1j, h2j) assert.NoError(t, err) - _, cB, betaPrm, pfB, err := BobMid(pk, pf, b, cA, NTildei, h1i, h2i, NTildej, h1j, h2j) + _, cB, betaPrm, pfB, err := BobMid(tss.EC(), pk, pf, b, cA, NTildei, h1i, h2i, NTildej, h1j, h2j) assert.NoError(t, err) - alpha, err := AliceEnd(pk, pfB, h1i, h2i, cA, cB, NTildei, sk) + alpha, err := AliceEnd(tss.EC(), pk, pfB, h1i, h2i, cA, cB, NTildei, sk) assert.NoError(t, err) // expect: alpha = ab + betaPrm @@ -74,15 +74,15 @@ func TestShareProtocolWC(t *testing.T) { cA, rA, err := pk.EncryptAndReturnRandomness(a) assert.NoError(t, err) - pf, err := AliceInit(pk, a, cA, rA, NTildej, h1j, h2j) + pf, err := AliceInit(tss.EC(), pk, a, cA, rA, NTildej, h1j, h2j) assert.NoError(t, err) gBPoint, err := crypto.NewECPoint(tss.EC(), gBX, gBY) assert.NoError(t, err) - betaPrm, cB, pfB, err := BobMidWC(pk, pf, b, cA, NTildei, h1i, h2i, NTildej, h1j, h2j, gBPoint) + betaPrm, cB, pfB, err := BobMidWC(tss.EC(), pk, pf, b, cA, NTildei, h1i, h2i, NTildej, h1j, h2j, gBPoint) assert.NoError(t, err) - muIJ, _, muRandIJ, err := AliceEndWC(pk, pfB, gBPoint, cA, cB, NTildei, h1i, h2i, sk) + muIJ, _, muRandIJ, err := AliceEndWC(tss.EC(), pk, pfB, gBPoint, cA, cB, NTildei, h1i, h2i, sk) assert.NoError(t, err) assert.NotNil(t, muRandIJ) diff --git a/ecdsa/keygen/local_party_test.go b/ecdsa/keygen/local_party_test.go index 565720ac..e035d0f1 100644 --- a/ecdsa/keygen/local_party_test.go +++ b/ecdsa/keygen/local_party_test.go @@ -225,9 +225,12 @@ func TestBadMessageCulprits(t *testing.T) { } assert.Equal(t, 1, len(err2.Culprits())) assert.Equal(t, pIDs[1], err2.Culprits()[0]) - assert.Equal(t, - "task ecdsa-keygen, party {0,P[1]}, round 1, culprits [{1,2}]: message failed ValidateBasic: Type: binance.tsslib.ecdsa.keygen.KGRound1Message, From: {1,2}", - err2.Error()) + assert.Regexpf(t, `^task ecdsa-keygen, party.+round 1, culprits.+message failed ValidateBasic.+KGRound1Message`, err2.Error(), "unexpected culprit error message") + assert.Regexpf(t, `^task ecdsa-keygen, party.+round 1, culprits.+1,.*2.+message failed ValidateBasic.+KGRound1Message`, err2.Error(), "unexpected culprit error message") + + // expected: "task ecdsa-keygen, party {0,P[1]}, round 1, culprits [{1,2}]: message failed ValidateBasic: Type: binance.tsslib.ecdsa.keygen.KGRound1Message, From: {1,2}", + // or "[...] culprits [{1,P[2]}]: message failed[...]" + } func TestE2EConcurrentAndSaveFixtures(t *testing.T) { diff --git a/ecdsa/keygen/round_1.go b/ecdsa/keygen/round_1.go index 51374e46..1a42f781 100644 --- a/ecdsa/keygen/round_1.go +++ b/ecdsa/keygen/round_1.go @@ -41,7 +41,7 @@ func (round *round1) Start() *tss.Error { // Fig 5. Round 1. private key part ridi := common.GetRandomPositiveInt(round.EC().Params().N) - ui := common.GetRandomPositiveInt(round.EC().Params().N) + ui := common.GetRandomPositiveInt(round.Params().EC().Params().N) // Fig 5. Round 1. pub key part, vss shares ids := round.Parties().IDs().Keys() diff --git a/ecdsa/signing/key_derivation_test.go b/ecdsa/signing/key_derivation_test.go index 39ad6c20..749514e1 100644 --- a/ecdsa/signing/key_derivation_test.go +++ b/ecdsa/signing/key_derivation_test.go @@ -28,7 +28,7 @@ import ( // in signing. Our code does not require updates u_i or the VSS commitment to the polynomial either, // as these are not used during the signing phase. func TestHDKeyDerivation(t *testing.T) { - setUp("debug") + setUp("info") threshold := testThreshold // PHASE: load keygen fixtures @@ -118,7 +118,7 @@ signing: bigR := crypto.NewECPointNoCurveCheck(tss.EC(), bigRX, bigRY) r := parties[0].temp.Rx - fmt.Printf("sign result: R(%s, %s), r=%s\n", bigR.X().String(), bigR.Y().String(), r.String()) + // fmt.Printf("sign result: R(%s, %s), r=%s\n", bigR.X().String(), bigR.Y().String(), r.String()) modN := common.ModInt(tss.EC().Params().N) @@ -127,7 +127,7 @@ signing: for _, p := range parties { sumS = modN.Add(sumS, p.temp.SigmaShare) } - fmt.Printf("S: %s\n", sumS.String()) + // fmt.Printf("S: %s\n", sumS.String()) // END check s correctness ok := ecdsa.Verify(&extendedChildPk.PublicKey, msg.Bytes(), bigR.X(), sumS) diff --git a/ecdsa/signing/local_party_test.go b/ecdsa/signing/local_party_test.go index 6cf6864c..17fdee27 100644 --- a/ecdsa/signing/local_party_test.go +++ b/ecdsa/signing/local_party_test.go @@ -375,7 +375,7 @@ func identifiedAbortUpdater(party tss.Party, msg tss.Message, parties []*LocalPa } func TestAbortIdentification(t *testing.T) { - setUp("debug") + setUp("info") threshold := testThreshold // PHASE: load keygen fixtures @@ -457,7 +457,7 @@ signing: } func TestIdAbortSimulateRound7(test *testing.T) { - setUp("debug") + setUp("info") var err error ec := tss.S256() q := ec.Params().N diff --git a/eddsa/resharing/messages.go b/eddsa/resharing/messages.go index a1e79f69..80cb32d7 100644 --- a/eddsa/resharing/messages.go +++ b/eddsa/resharing/messages.go @@ -26,6 +26,7 @@ var ( (*DGRound2Message)(nil), (*DGRound3Message1)(nil), (*DGRound3Message2)(nil), + (*DGRound4Message)(nil), } ) diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index c9366f14..0cbc872f 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -35,10 +35,13 @@ func setUp(level string) { if err := log.SetLogLevel("tss-lib", level); err != nil { panic(err) } + + // only for test + tss.SetCurve(tss.Edwards()) } func TestE2EConcurrentEdwards(t *testing.T) { - setUp("debug") + setUp("info") threshold := testThreshold @@ -120,7 +123,7 @@ signing: // BEGIN EDDSA verify pkX, pkY := keys[0].EDDSAPub.X(), keys[0].EDDSAPub.Y() pk := edwards.PublicKey{ - Curve: tss.EC(), + Curve: tss.Edwards(), X: pkX, Y: pkY, } @@ -151,7 +154,7 @@ signing: } func TestE2EConcurrentS256Schnorr(t *testing.T) { - setUp("debug") + setUp("info") threshold := testThreshold diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index 851312a1..cb5b3489 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -241,7 +241,7 @@ func schnorrVerify(hash []byte, pub *btcec.PublicKey, sigR btcec.FieldVal, sigS var _ePAffine btcec.JacobianPoint _ePAffine.X, _ePAffine.Y, _ePAffine.Z = eP.X, eP.Y, eP.Z _ePAffine.ToAffine() - common.Logger.Infof("finalize - (minus)e: %v, P: %v, _sGAffine: %v, -ePAffine: %v", e.String(), + common.Logger.Debugf("finalize - (minus)e: %v, P: %v, _sGAffine: %v, -ePAffine: %v", e.String(), JacobianPointToString(P), JacobianPointToString(_sGAffine), JacobianPointToString(_ePAffine)) diff --git a/tss/message.go b/tss/message.go index d34ecb26..26ec8cb4 100644 --- a/tss/message.go +++ b/tss/message.go @@ -9,7 +9,7 @@ package tss import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" ) @@ -81,7 +81,7 @@ var ( // NewMessageWrapper constructs a MessageWrapper from routing metadata and content func NewMessageWrapper(routing MessageRouting, content MessageContent) *MessageWrapper { // marshal the content to the ProtoBuf Any type - any, _ := anypb.New(proto.MessageV2(content)) + any, _ := anypb.New(content) // convert given PartyIDs to the wire format var to []*MessageWrapper_PartyID if routing.To != nil { @@ -111,7 +111,7 @@ func NewMessage(meta MessageRouting, content MessageContent, wire *MessageWrappe } func (mm *MessageImpl) Type() string { - return proto.MessageName(mm.content) + return string(proto.MessageName(mm.content)) } func (mm *MessageImpl) GetTo() []*PartyID { diff --git a/tss/wire.go b/tss/wire.go index bb9234ba..01083fe3 100644 --- a/tss/wire.go +++ b/tss/wire.go @@ -9,20 +9,14 @@ package tss import ( "errors" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/any" -) - -const ( - ECDSAProtoNamePrefix = "binance.tss-lib.ecdsa." - EDDSAProtoNamePrefix = "binance.tss-lib.eddsa." + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" ) // Used externally to update a LocalParty with a valid ParsedMessage func ParseWireMessage(wireBytes []byte, from *PartyID, isBroadcast bool) (ParsedMessage, error) { wire := new(MessageWrapper) - wire.Message = new(any.Any) + wire.Message = new(anypb.Any) wire.From = from.MessageWrapper_PartyID wire.IsBroadcast = isBroadcast if err := proto.Unmarshal(wireBytes, wire.Message); err != nil { @@ -32,15 +26,15 @@ func ParseWireMessage(wireBytes []byte, from *PartyID, isBroadcast bool) (Parsed } func parseWrappedMessage(wire *MessageWrapper, from *PartyID) (ParsedMessage, error) { - var any ptypes.DynamicAny + m, err := wire.Message.UnmarshalNew() + if err != nil { + return nil, err + } meta := MessageRouting{ From: from, IsBroadcast: wire.IsBroadcast, } - if err := ptypes.UnmarshalAny(wire.Message, &any); err != nil { - return nil, err - } - if content, ok := any.Message.(MessageContent); ok { + if content, ok := m.(MessageContent); ok { return NewMessage(meta, content, wire), nil } return nil, errors.New("ParseWireMessage: the message contained unknown content") From 0a3f5fdece3e95c4ba99053aa077067904e6f8ce Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Thu, 27 Jan 2022 11:57:11 -0500 Subject: [PATCH 13/33] MTA unit tests: hard-coded constants instead of fixture files. --- ecdsa/keygen/test_utils.go | 14 ++++++++++++++ ecdsa/signing/mta_test.go | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ecdsa/keygen/test_utils.go b/ecdsa/keygen/test_utils.go index 81355fca..2081da86 100644 --- a/ecdsa/keygen/test_utils.go +++ b/ecdsa/keygen/test_utils.go @@ -7,6 +7,7 @@ package keygen import ( + "encoding/hex" "encoding/json" "fmt" "io/ioutil" @@ -28,11 +29,18 @@ const ( TestParticipants = test.TestParticipants TestThreshold = test.TestThreshold ) + const ( testFixtureDirFormat = "%s/../../test/_ecdsa_fixtures" testFixtureFileFormat = "keygen_data_%d.json" ) +var ( + constTestNTildei, _ = hex.DecodeString("deaf005da2e13f26b1821700f495b4bc9f29145055ec1fdba496b85fcd5b217190473c42176104381cc0475385e929798fd09fec37626082e825bdadd54e3910e9e55a0a45903c57ec9f4c26006c62c5d81725d94a3d3ddbe427ef34f11b7f177f78862fff4612d9536272c5951aee9974bb98bdbfebcd4ad40ee26204f3425d18dde90e6976a5cfdd2fb8a476ee5be3fbd6fd5f32d5697735df420f84d6c4ad6f4754dcea0a3f036aeeeefbf65337694f14e442cba0e862449174e7d6edd023cbad7329adae6917fcc028de5e3fc681e6a601ef2de7503a3485b6809ee54dc82ab8edc178a934b42b2dd9b7b778307050373f6b51b20179ef3997befebeb3d5") + constTestH1i, _ = hex.DecodeString("8a263bf5d5b19bd0c0ca2a57d7181f987a0ad39ece0ad3dbf747cbcaa4296f048e3b8306a25bb9fb426b00cb78423e8f741e7e1b48bc6c3cb8d036cc482b5734888e66eecb0b33afd026f2bd98fc2ca57aede26f82f416accfc21999442b10fdfa7a962a8607ff10eeb2f3512b0bfa72097cdcc65fe25a1f6681b605804fa2f554e972b9f10931094d1edc3888f1cb98528a77cea2a9597a2c91177e4d28ec50d32a2b26162c28988fac633c5839db916e00a56e5b33130fefd5662ddca80224fd1b9d924f676b944b387b89a283e02aab9def9d3e9be04f59a8b2545b6a55f4a5a4e996d0b2ae431baad205f5a47067bea561885c55a16e52f36bda2a36bc4d") + constTestH2i, _ = hex.DecodeString("d375f48fda5728f8d8db394dde4c024922c23ac8e09ba84bf14360da0ded6a257416baac2ef6879aa508f57dd31e120d05976126673dd5df4d677cf24c87eb52dcdd6c47da61c4e221ae45bfa19e088784d7a512f8f0a90fedfbea44e05abe95120a9ec8a0d0bea473677b390a220bd7a83e3d79482314109b17ab8b596f2b46b8c1620ce232a44245c920cbfc7ac94010181c4d10c4cece99da3f3a20359ec3271666b7885b6a94538a7ab4d70066ddeb30a6f40b036f3f9e61dfc4bfdf91a5e2e9719e4ab65f479e9f66fef347795abb0f8ce47ac9ca0aa75471c9fafdba72d2e3b4c7ae231fcefd3bffdc93292b16cc8a28a0c935de64c33d91f750d63635") +) + func LoadKeygenTestFixtures(qty int, optionalStart ...int) ([]LocalPartySaveData, tss.SortedPartyIDs, error) { keys := make([]LocalPartySaveData, 0, qty) start := 0 @@ -120,6 +128,12 @@ func LoadNTildeH1H2FromTestFixture(idx int) (NTildei, h1i, h2i *big.Int, err err return } +func ConstantTestNTildeH1H2() (NTildei, h1i, h2i *big.Int, err error) { + NTildei = big.NewInt(0).SetBytes(constTestNTildei) + h1i, h2i = big.NewInt(0).SetBytes(constTestH1i), big.NewInt(0).SetBytes(constTestH2i) + return +} + func makeTestFixtureFilePath(partyIndex int) string { _, callerFileName, _, _ := runtime.Caller(0) srcDirName := filepath.Dir(callerFileName) diff --git a/ecdsa/signing/mta_test.go b/ecdsa/signing/mta_test.go index 9c1cea58..6027f8c0 100644 --- a/ecdsa/signing/mta_test.go +++ b/ecdsa/signing/mta_test.go @@ -46,7 +46,7 @@ func TestAffg(test *testing.T) { gammai := common.GetRandomPositiveInt(q) BigGammai := crypto.ScalarBaseMult(ec, gammai) - NCap, s, t, err := keygen.LoadNTildeH1H2FromTestFixture(1) + NCap, s, t, err := keygen.ConstantTestNTildeH1H2() assert.NoError(test, err) MtaOut, err := NewMtA(ec, Kj, gammai, BigGammai, pkj, pki, NCap, s, t) @@ -83,7 +83,7 @@ func TestDec(test *testing.T) { 𝛾i := common.GetRandomPositiveInt(q) Γi := crypto.ScalarBaseMult(ec, 𝛾i) - NCap, s, t, err := keygen.LoadNTildeH1H2FromTestFixture(1) + NCap, s, t, err := keygen.ConstantTestNTildeH1H2() assert.NoError(test, err) N2 := pkj.NSquare() From 97fda5fdb94ff8a50a6ebcda595e8001dd1658c5 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Thu, 27 Jan 2022 13:59:56 -0500 Subject: [PATCH 14/33] Hard-coded constants instead of fixture files for certain unit tests. No functional change to protocol. --- Makefile | 16 +++++++++++----- crypto/mta/share_protocol_test.go | 8 ++++---- crypto/zkp/affg/affg_test.go | 2 +- ecdsa/keygen/test_utils.go | 21 +++++++++++++++------ ecdsa/signing/mta_test.go | 4 ++-- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index b6757f34..f0acd6ca 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ test_unit_level0: go clean -testcache rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json - go test -v -timeout 30m $(UT_PACKAGES_LEVEL_0) + go test -v -timeout 50m $(UT_PACKAGES_LEVEL_0) test_unit: test_unit_level0 @@ -56,15 +56,21 @@ test_unit: test_unit_level0 sleep 2 go test -v -timeout 60m $(UT_PACKAGES_LEVEL_1) -test_unit_race: - @echo "--> Running Unit Tests (with Race Detection)" +test_unit_race_level0: + @echo "--> Running Unit Tests (with Race Detection) - Level 0" @echo "!!! WARNING: This will take a long time :)" @echo "!!! WARNING: This will delete fixtures :(" - # go clean -testcache + go clean -testcache sleep 10 rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json - go test -v -timeout 10m -race $(DEPENDENCIES_PACKAGES) + go test -v -timeout 50m -race $(UT_PACKAGES_LEVEL_0) + +test_unit_race: test_unit_race_level0 + @echo "--> Running Unit Tests (with Race Detection) - Level 1" + @echo "!!! WARNING: This will take a long time :)" + sleep 2 + go test -v -timeout 60m -race $(UT_PACKAGES_LEVEL_1) test: make test_unit_race diff --git a/crypto/mta/share_protocol_test.go b/crypto/mta/share_protocol_test.go index 4f9ca063..d65915d2 100644 --- a/crypto/mta/share_protocol_test.go +++ b/crypto/mta/share_protocol_test.go @@ -34,9 +34,9 @@ func TestShareProtocol(t *testing.T) { a := common.GetRandomPositiveInt(q) b := common.GetRandomPositiveInt(q) - NTildei, h1i, h2i, err := keygen.LoadNTildeH1H2FromTestFixture(0) + NTildei, h1i, h2i, err := keygen.ConstantTestNTildeH1H2(0) assert.NoError(t, err) - NTildej, h1j, h2j, err := keygen.LoadNTildeH1H2FromTestFixture(1) + NTildej, h1j, h2j, err := keygen.ConstantTestNTildeH1H2(1) assert.NoError(t, err) cA, rA, err := pk.EncryptAndReturnRandomness(a) @@ -67,9 +67,9 @@ func TestShareProtocolWC(t *testing.T) { b := common.GetRandomPositiveInt(q) gBX, gBY := tss.EC().ScalarBaseMult(b.Bytes()) - NTildei, h1i, h2i, err := keygen.LoadNTildeH1H2FromTestFixture(0) + NTildei, h1i, h2i, err := keygen.ConstantTestNTildeH1H2(0) assert.NoError(t, err) - NTildej, h1j, h2j, err := keygen.LoadNTildeH1H2FromTestFixture(1) + NTildej, h1j, h2j, err := keygen.ConstantTestNTildeH1H2(1) assert.NoError(t, err) cA, rA, err := pk.EncryptAndReturnRandomness(a) diff --git a/crypto/zkp/affg/affg_test.go b/crypto/zkp/affg/affg_test.go index 4320c7f1..3737d6f5 100644 --- a/crypto/zkp/affg/affg_test.go +++ b/crypto/zkp/affg/affg_test.go @@ -49,7 +49,7 @@ func TestAffg(test *testing.T) { Y, rhoy, err := pk1.EncryptAndReturnRandomness(y) assert.NoError(test, err) - NCap, s, t, err := keygen.LoadNTildeH1H2FromTestFixture(1) + NCap, s, t, err := keygen.ConstantTestNTildeH1H2(1) assert.NoError(test, err) C, _, err := pk0.EncryptAndReturnRandomness(a) diff --git a/ecdsa/keygen/test_utils.go b/ecdsa/keygen/test_utils.go index 2081da86..be72dd9b 100644 --- a/ecdsa/keygen/test_utils.go +++ b/ecdsa/keygen/test_utils.go @@ -17,6 +17,7 @@ import ( "runtime" "sort" + "github.com/binance-chain/tss-lib/common" "github.com/pkg/errors" "github.com/binance-chain/tss-lib/test" @@ -36,9 +37,17 @@ const ( ) var ( - constTestNTildei, _ = hex.DecodeString("deaf005da2e13f26b1821700f495b4bc9f29145055ec1fdba496b85fcd5b217190473c42176104381cc0475385e929798fd09fec37626082e825bdadd54e3910e9e55a0a45903c57ec9f4c26006c62c5d81725d94a3d3ddbe427ef34f11b7f177f78862fff4612d9536272c5951aee9974bb98bdbfebcd4ad40ee26204f3425d18dde90e6976a5cfdd2fb8a476ee5be3fbd6fd5f32d5697735df420f84d6c4ad6f4754dcea0a3f036aeeeefbf65337694f14e442cba0e862449174e7d6edd023cbad7329adae6917fcc028de5e3fc681e6a601ef2de7503a3485b6809ee54dc82ab8edc178a934b42b2dd9b7b778307050373f6b51b20179ef3997befebeb3d5") - constTestH1i, _ = hex.DecodeString("8a263bf5d5b19bd0c0ca2a57d7181f987a0ad39ece0ad3dbf747cbcaa4296f048e3b8306a25bb9fb426b00cb78423e8f741e7e1b48bc6c3cb8d036cc482b5734888e66eecb0b33afd026f2bd98fc2ca57aede26f82f416accfc21999442b10fdfa7a962a8607ff10eeb2f3512b0bfa72097cdcc65fe25a1f6681b605804fa2f554e972b9f10931094d1edc3888f1cb98528a77cea2a9597a2c91177e4d28ec50d32a2b26162c28988fac633c5839db916e00a56e5b33130fefd5662ddca80224fd1b9d924f676b944b387b89a283e02aab9def9d3e9be04f59a8b2545b6a55f4a5a4e996d0b2ae431baad205f5a47067bea561885c55a16e52f36bda2a36bc4d") - constTestH2i, _ = hex.DecodeString("d375f48fda5728f8d8db394dde4c024922c23ac8e09ba84bf14360da0ded6a257416baac2ef6879aa508f57dd31e120d05976126673dd5df4d677cf24c87eb52dcdd6c47da61c4e221ae45bfa19e088784d7a512f8f0a90fedfbea44e05abe95120a9ec8a0d0bea473677b390a220bd7a83e3d79482314109b17ab8b596f2b46b8c1620ce232a44245c920cbfc7ac94010181c4d10c4cece99da3f3a20359ec3271666b7885b6a94538a7ab4d70066ddeb30a6f40b036f3f9e61dfc4bfdf91a5e2e9719e4ab65f479e9f66fef347795abb0f8ce47ac9ca0aa75471c9fafdba72d2e3b4c7ae231fcefd3bffdc93292b16cc8a28a0c935de64c33d91f750d63635") + constTestNTildei0, _ = hex.DecodeString("deaf005da2e13f26b1821700f495b4bc9f29145055ec1fdba496b85fcd5b217190473c42176104381cc0475385e929798fd09fec37626082e825bdadd54e3910e9e55a0a45903c57ec9f4c26006c62c5d81725d94a3d3ddbe427ef34f11b7f177f78862fff4612d9536272c5951aee9974bb98bdbfebcd4ad40ee26204f3425d18dde90e6976a5cfdd2fb8a476ee5be3fbd6fd5f32d5697735df420f84d6c4ad6f4754dcea0a3f036aeeeefbf65337694f14e442cba0e862449174e7d6edd023cbad7329adae6917fcc028de5e3fc681e6a601ef2de7503a3485b6809ee54dc82ab8edc178a934b42b2dd9b7b778307050373f6b51b20179ef3997befebeb3d5") + constTestH1i0, _ = hex.DecodeString("8a263bf5d5b19bd0c0ca2a57d7181f987a0ad39ece0ad3dbf747cbcaa4296f048e3b8306a25bb9fb426b00cb78423e8f741e7e1b48bc6c3cb8d036cc482b5734888e66eecb0b33afd026f2bd98fc2ca57aede26f82f416accfc21999442b10fdfa7a962a8607ff10eeb2f3512b0bfa72097cdcc65fe25a1f6681b605804fa2f554e972b9f10931094d1edc3888f1cb98528a77cea2a9597a2c91177e4d28ec50d32a2b26162c28988fac633c5839db916e00a56e5b33130fefd5662ddca80224fd1b9d924f676b944b387b89a283e02aab9def9d3e9be04f59a8b2545b6a55f4a5a4e996d0b2ae431baad205f5a47067bea561885c55a16e52f36bda2a36bc4d") + constTestH2i0, _ = hex.DecodeString("d375f48fda5728f8d8db394dde4c024922c23ac8e09ba84bf14360da0ded6a257416baac2ef6879aa508f57dd31e120d05976126673dd5df4d677cf24c87eb52dcdd6c47da61c4e221ae45bfa19e088784d7a512f8f0a90fedfbea44e05abe95120a9ec8a0d0bea473677b390a220bd7a83e3d79482314109b17ab8b596f2b46b8c1620ce232a44245c920cbfc7ac94010181c4d10c4cece99da3f3a20359ec3271666b7885b6a94538a7ab4d70066ddeb30a6f40b036f3f9e61dfc4bfdf91a5e2e9719e4ab65f479e9f66fef347795abb0f8ce47ac9ca0aa75471c9fafdba72d2e3b4c7ae231fcefd3bffdc93292b16cc8a28a0c935de64c33d91f750d63635") + + constTestNTildei1, _ = hex.DecodeString("deaf005da2e13f26b1821700f495b4bc9f29145055ec1fdba496b85fcd5b217190473c42176104381cc0475385e929798fd09fec37626082e825bdadd54e3910e9e55a0a45903c57ec9f4c26006c62c5d81725d94a3d3ddbe427ef34f11b7f177f78862fff4612d9536272c5951aee9974bb98bdbfebcd4ad40ee26204f3425d18dde90e6976a5cfdd2fb8a476ee5be3fbd6fd5f32d5697735df420f84d6c4ad6f4754dcea0a3f036aeeeefbf65337694f14e442cba0e862449174e7d6edd023cbad7329adae6917fcc028de5e3fc681e6a601ef2de7503a3485b6809ee54dc82ab8edc178a934b42b2dd9b7b778307050373f6b51b20179ef3997befebeb3d5") + constTestH1i1, _ = hex.DecodeString("8a263bf5d5b19bd0c0ca2a57d7181f987a0ad39ece0ad3dbf747cbcaa4296f048e3b8306a25bb9fb426b00cb78423e8f741e7e1b48bc6c3cb8d036cc482b5734888e66eecb0b33afd026f2bd98fc2ca57aede26f82f416accfc21999442b10fdfa7a962a8607ff10eeb2f3512b0bfa72097cdcc65fe25a1f6681b605804fa2f554e972b9f10931094d1edc3888f1cb98528a77cea2a9597a2c91177e4d28ec50d32a2b26162c28988fac633c5839db916e00a56e5b33130fefd5662ddca80224fd1b9d924f676b944b387b89a283e02aab9def9d3e9be04f59a8b2545b6a55f4a5a4e996d0b2ae431baad205f5a47067bea561885c55a16e52f36bda2a36bc4d") + constTestH2i1, _ = hex.DecodeString("d375f48fda5728f8d8db394dde4c024922c23ac8e09ba84bf14360da0ded6a257416baac2ef6879aa508f57dd31e120d05976126673dd5df4d677cf24c87eb52dcdd6c47da61c4e221ae45bfa19e088784d7a512f8f0a90fedfbea44e05abe95120a9ec8a0d0bea473677b390a220bd7a83e3d79482314109b17ab8b596f2b46b8c1620ce232a44245c920cbfc7ac94010181c4d10c4cece99da3f3a20359ec3271666b7885b6a94538a7ab4d70066ddeb30a6f40b036f3f9e61dfc4bfdf91a5e2e9719e4ab65f479e9f66fef347795abb0f8ce47ac9ca0aa75471c9fafdba72d2e3b4c7ae231fcefd3bffdc93292b16cc8a28a0c935de64c33d91f750d63635") + + constTestNTildeiArray = [][]byte{constTestNTildei0, constTestNTildei1} + constTestH1iArray = [][]byte{constTestH1i0, constTestH1i1} + constTestH2iArray = [][]byte{constTestH2i0, constTestH2i1} ) func LoadKeygenTestFixtures(qty int, optionalStart ...int) ([]LocalPartySaveData, tss.SortedPartyIDs, error) { @@ -128,9 +137,9 @@ func LoadNTildeH1H2FromTestFixture(idx int) (NTildei, h1i, h2i *big.Int, err err return } -func ConstantTestNTildeH1H2() (NTildei, h1i, h2i *big.Int, err error) { - NTildei = big.NewInt(0).SetBytes(constTestNTildei) - h1i, h2i = big.NewInt(0).SetBytes(constTestH1i), big.NewInt(0).SetBytes(constTestH2i) +func ConstantTestNTildeH1H2(idx int) (NTildei, h1i, h2i *big.Int, err error) { + NTildei = big.NewInt(0).SetBytes(constTestNTildeiArray[idx]) + h1i, h2i = big.NewInt(0).SetBytes(constTestH1iArray[idx]), big.NewInt(0).SetBytes(constTestH2iArray[idx]) return } diff --git a/ecdsa/signing/mta_test.go b/ecdsa/signing/mta_test.go index 6027f8c0..142adf87 100644 --- a/ecdsa/signing/mta_test.go +++ b/ecdsa/signing/mta_test.go @@ -46,7 +46,7 @@ func TestAffg(test *testing.T) { gammai := common.GetRandomPositiveInt(q) BigGammai := crypto.ScalarBaseMult(ec, gammai) - NCap, s, t, err := keygen.ConstantTestNTildeH1H2() + NCap, s, t, err := keygen.ConstantTestNTildeH1H2(1) assert.NoError(test, err) MtaOut, err := NewMtA(ec, Kj, gammai, BigGammai, pkj, pki, NCap, s, t) @@ -83,7 +83,7 @@ func TestDec(test *testing.T) { 𝛾i := common.GetRandomPositiveInt(q) Γi := crypto.ScalarBaseMult(ec, 𝛾i) - NCap, s, t, err := keygen.ConstantTestNTildeH1H2() + NCap, s, t, err := keygen.ConstantTestNTildeH1H2(1) assert.NoError(test, err) N2 := pkj.NSquare() From 2be88a65d2079663684ce5e139c95d6252fcfca2 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Thu, 27 Jan 2022 14:05:57 -0500 Subject: [PATCH 15/33] Removing unused import in test util file. --- ecdsa/keygen/test_utils.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ecdsa/keygen/test_utils.go b/ecdsa/keygen/test_utils.go index be72dd9b..5d2e52b6 100644 --- a/ecdsa/keygen/test_utils.go +++ b/ecdsa/keygen/test_utils.go @@ -17,7 +17,6 @@ import ( "runtime" "sort" - "github.com/binance-chain/tss-lib/common" "github.com/pkg/errors" "github.com/binance-chain/tss-lib/test" From 2862aa25d3e2f656650ebcf6241836a8b8cc2447 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Thu, 27 Jan 2022 16:36:48 -0500 Subject: [PATCH 16/33] Minor fixes to unit tests. No functional change to protocols. --- Makefile | 8 ++++---- common/slice.go | 10 ++++++++++ crypto/zkp/mod/mod_test.go | 2 +- ecdsa/signing/local_party_test.go | 14 +++++++------- ecdsa/signing/sign_out.go | 14 ++------------ eddsa/keygen/local_party_test.go | 13 ++++++++----- 6 files changed, 32 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index f0acd6ca..2137529a 100644 --- a/Makefile +++ b/Makefile @@ -47,14 +47,14 @@ test_unit_level0: go clean -testcache rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json - go test -v -timeout 50m $(UT_PACKAGES_LEVEL_0) + go test -timeout 50m $(UT_PACKAGES_LEVEL_0) test_unit: test_unit_level0 @echo "--> Running Unit Tests - Level 1" @echo "!!! WARNING: This will take a long time :)" sleep 2 - go test -v -timeout 60m $(UT_PACKAGES_LEVEL_1) + go test -timeout 60m $(UT_PACKAGES_LEVEL_1) test_unit_race_level0: @echo "--> Running Unit Tests (with Race Detection) - Level 0" @@ -64,13 +64,13 @@ test_unit_race_level0: sleep 10 rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json - go test -v -timeout 50m -race $(UT_PACKAGES_LEVEL_0) + go test -timeout 50m -race $(UT_PACKAGES_LEVEL_0) test_unit_race: test_unit_race_level0 @echo "--> Running Unit Tests (with Race Detection) - Level 1" @echo "!!! WARNING: This will take a long time :)" sleep 2 - go test -v -timeout 60m -race $(UT_PACKAGES_LEVEL_1) + go test -timeout 60m -race $(UT_PACKAGES_LEVEL_1) test: make test_unit_race diff --git a/common/slice.go b/common/slice.go index f48dc1d4..2162cc8c 100644 --- a/common/slice.go +++ b/common/slice.go @@ -78,3 +78,13 @@ func AnyNonEmptyMultiByte(bzs [][]byte, expectLen ...int) bool { } return false } + +func PadToLengthBytesInPlace(src []byte, length int) []byte { + oriLen := len(src) + if oriLen < length { + for i := 0; i < length-oriLen; i++ { + src = append([]byte{0}, src...) + } + } + return src +} diff --git a/crypto/zkp/mod/mod_test.go b/crypto/zkp/mod/mod_test.go index b2eef112..432c6385 100644 --- a/crypto/zkp/mod/mod_test.go +++ b/crypto/zkp/mod/mod_test.go @@ -17,7 +17,7 @@ import ( ) func TestMod(test *testing.T) { - preParams, err := keygen.GeneratePreParams(time.Minute*10, 8) + preParams, err := keygen.GeneratePreParams(time.Minute*20, 8) assert.NoError(test, err) p, q, N := preParams.P, preParams.Q, preParams.NTildei diff --git a/ecdsa/signing/local_party_test.go b/ecdsa/signing/local_party_test.go index 17fdee27..f6538148 100644 --- a/ecdsa/signing/local_party_test.go +++ b/ecdsa/signing/local_party_test.go @@ -137,8 +137,8 @@ signing: if atomic.LoadInt32(&ended) == int32(len(signPIDs)) { t.Logf("Done. Received signature data from %d participants", ended) R := parties[0].temp.BigR - r := parties[0].temp.Rx - fmt.Printf("sign result: R(%s, %s), r=%s\n", R.X().String(), R.Y().String(), r.String()) + // r := parties[0].temp.Rx + // fmt.Printf("sign result: R(%s, %s), r=%s\n", R.X().String(), R.Y().String(), r.String()) modN := common.ModInt(tss.S256().Params().N) @@ -147,7 +147,7 @@ signing: for _, p := range parties { sumS = modN.Add(sumS, p.temp.SigmaShare) } - fmt.Printf("S: %s\n", sumS.String()) + // fmt.Printf("S: %s\n", sumS.String()) // END check s correctness // BEGIN ECDSA verify @@ -246,8 +246,8 @@ signing: if atomic.LoadInt32(&ended) == int32(len(signPIDs)) { t.Logf("Done. Received signature data from %d participants", ended) R := parties[0].temp.BigR - r := parties[0].temp.Rx - fmt.Printf("sign result: R(%s, %s), r=%s\n", R.X().String(), R.Y().String(), r.String()) + // r := parties[0].temp.Rx + // fmt.Printf("sign result: R(%s, %s), r=%s\n", R.X().String(), R.Y().String(), r.String()) modN := common.ModInt(tss.S256().Params().N) @@ -256,7 +256,7 @@ signing: for _, p := range parties { sumS = modN.Add(sumS, p.temp.SigmaShare) } - fmt.Printf("S: %s\n", sumS.String()) + // fmt.Printf("S: %s\n", sumS.String()) // END check s correctness // BEGIN ECDSA verify @@ -636,7 +636,7 @@ func TestIdAbortSimulateRound7(test *testing.T) { func TestFillTo32BytesInPlace(t *testing.T) { s := big.NewInt(123456789) - normalizedS := padToLengthBytesInPlace(s.Bytes(), 32) + normalizedS := common.PadToLengthBytesInPlace(s.Bytes(), 32) assert.True(t, big.NewInt(0).SetBytes(normalizedS).Cmp(s) == 0) assert.Equal(t, 32, len(normalizedS)) assert.NotEqual(t, 32, len(s.Bytes())) diff --git a/ecdsa/signing/sign_out.go b/ecdsa/signing/sign_out.go index 5d6c2efd..0b640ef6 100644 --- a/ecdsa/signing/sign_out.go +++ b/ecdsa/signing/sign_out.go @@ -74,8 +74,8 @@ func (round *signout) Start() *tss.Error { // save the signature for final output bitSizeInBytes := round.Params().EC().Params().BitSize / 8 - round.data.R = padToLengthBytesInPlace(round.temp.Rx.Bytes(), bitSizeInBytes) - round.data.S = padToLengthBytesInPlace(Sigma.Bytes(), bitSizeInBytes) + round.data.R = common.PadToLengthBytesInPlace(round.temp.Rx.Bytes(), bitSizeInBytes) + round.data.S = common.PadToLengthBytesInPlace(Sigma.Bytes(), bitSizeInBytes) round.data.Signature = append(round.data.R, round.data.S...) round.data.SignatureRecovery = []byte{byte(recid)} round.data.M = round.temp.m.Bytes() @@ -109,13 +109,3 @@ func (round *signout) Update() (bool, *tss.Error) { func (round *signout) NextRound() tss.Round { return nil // finished! } - -func padToLengthBytesInPlace(src []byte, length int) []byte { - oriLen := len(src) - if oriLen < length { - for i := 0; i < length-oriLen; i++ { - src = append([]byte{0}, src...) - } - } - return src -} diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index 57d2e141..29bce406 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -121,6 +121,7 @@ keygen: // combine shares for each Pj to get u u := new(big.Int) + modQ := common.ModInt(tss.Edwards().Params().N) for j, Pj := range parties { pShares := make(vss.Shares, 0) for j2, P := range parties { @@ -161,9 +162,8 @@ keygen: assert.NotEqual(t, BigXjX, Pj.temp.vs[0].X()) assert.NotEqual(t, BigXjY, Pj.temp.vs[0].Y()) } - u = new(big.Int).Add(u, uj) + u = modQ.Add(u, uj) } - u = new(big.Int).Mod(u, tss.Edwards().Params().N) scalar := make([]byte, 0, 32) copy(scalar, u.Bytes()) @@ -174,8 +174,10 @@ keygen: X: pkX, Y: pkY, } - println("u len: ", len(u.Bytes())) - sk, _, err := edwards.PrivKeyFromScalar(u.Bytes()) + t.Logf("u len: %v", len(u.Bytes())) + uBytes := common.PadToLengthBytesInPlace(u.Bytes(), edwards.PrivScalarSize) + sk, _, err := edwards.PrivKeyFromScalar(uBytes) + assert.NoError(t, err, "error loading private key") // fmt.Println("err: ", err.Error()) // test pub key, should be on curve and match pkX, pkY @@ -343,6 +345,8 @@ keygen: u = new(big.Int).Add(u, uj) } u = new(big.Int).Mod(u, tss.S256().Params().N) + t.Logf("u len: %v", len(u.Bytes())) + scalar := make([]byte, 0, 32) copy(scalar, u.Bytes()) @@ -353,7 +357,6 @@ keygen: X: pkX, Y: pkY, } - println("u len: ", len(u.Bytes())) sk, _ := btcec.PrivKeyFromBytes(u.Bytes()) // fmt.Println("err: ", err.Error()) From 4155de9e27fd694ea14fe45a4dc6c07718738c20 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Fri, 28 Jan 2022 15:00:48 +0800 Subject: [PATCH 17/33] delete test fixtures from repo --- test/_ecdsa_fixtures/keygen_data_0.json | 1 - test/_ecdsa_fixtures/keygen_data_1.json | 1 - test/_ecdsa_fixtures/keygen_data_2.json | 1 - test/_ecdsa_fixtures/keygen_data_3.json | 1 - test/_ecdsa_fixtures/keygen_data_4.json | 1 - test/_eddsa_fixtures/keygen_data_Edwards_0.json | 1 - test/_eddsa_fixtures/keygen_data_Edwards_1.json | 1 - test/_eddsa_fixtures/keygen_data_Edwards_2.json | 1 - test/_eddsa_fixtures/keygen_data_Edwards_3.json | 1 - test/_eddsa_fixtures/keygen_data_Edwards_4.json | 1 - test/_eddsa_fixtures/keygen_data_S256_0.json | 1 - test/_eddsa_fixtures/keygen_data_S256_1.json | 1 - test/_eddsa_fixtures/keygen_data_S256_2.json | 1 - test/_eddsa_fixtures/keygen_data_S256_3.json | 1 - test/_eddsa_fixtures/keygen_data_S256_4.json | 1 - 15 files changed, 15 deletions(-) delete mode 100644 test/_ecdsa_fixtures/keygen_data_0.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_1.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_2.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_3.json delete mode 100644 test/_ecdsa_fixtures/keygen_data_4.json delete mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_0.json delete mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_1.json delete mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_2.json delete mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_3.json delete mode 100644 test/_eddsa_fixtures/keygen_data_Edwards_4.json delete mode 100644 test/_eddsa_fixtures/keygen_data_S256_0.json delete mode 100644 test/_eddsa_fixtures/keygen_data_S256_1.json delete mode 100644 test/_eddsa_fixtures/keygen_data_S256_2.json delete mode 100644 test/_eddsa_fixtures/keygen_data_S256_3.json delete mode 100644 test/_eddsa_fixtures/keygen_data_S256_4.json diff --git a/test/_ecdsa_fixtures/keygen_data_0.json b/test/_ecdsa_fixtures/keygen_data_0.json deleted file mode 100644 index bdfc8cf0..00000000 --- a/test/_ecdsa_fixtures/keygen_data_0.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,"LambdaN":10812068832893660299642954853261212300141417956157022207301487519451795113663473079004365766701371639662862872698905465522170109446008320189219096753245083503808850225878684350020700922043634311494740550351606830704158075010744927386667954501509148753333093308033705375234902496727956015699976147977751462284274573217035723036620143848464849587038753406494800781971774785272895229303767153090846470978987892576160496406478758337770127976724364005118716004783230795128301701278030234216992521310552045470752943756068836826384513258633962922485583433823103731965994456953510368820600195567636921650077471824976346308314,"PhiN":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568549146434071446073240287696929699174077506812989601563943549570545790458607534306181692941957975785152320992812957516675540255953448728010237432009566461590256603402556060468433985042621104090941505887512137673652769026517267925844971166867646207463931988913907020737641200391135273843300154943649952692616628},"NTildei":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,"H1i":10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,"H2i":6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,"Alpha":7595449564670872179836477275908037953129653706099200313612545475640696571205045954514917036862616897292196838334038624984783777811792793730646019053784472582201667916824934432528927054625275697052379541804780291471097102935375275559126685377170445312431427279089963191137566830129693620426603351718458658339904913056645805615531913246798978513641159830240202501185483903859297375192265370256689451220893032101113516504943791441297236917682387308685422276414745681957760650855311004851432989686465750487368742890159383897427473076580830927300722407422012686395926029290086559013126325693805633691595395331010149629841,"Beta":1027994974675799020269188236528404506067863668700434115918821680859143024024051101026472614778588741429660646024583229553176672893620319756764640159488380199855292255335690957748930582951693958190728775981804204068906506791037967650802152813108413328413417469434890897948934960325900585114782675229282123902634376520395967293593515322512481219663421902465150396456168099527663396564750257218428768468231328800853696204183368043333071206585128173731406212943850768933974944397200327729256046701874461263459119140988700544659395931114993153640032150356186411170833409638565582627741629692020796888643605183559381315817,"P":68991576126999044763117577276740358704221158228349017685354104041451304594550087413364019473650780604747497398586722829026853638558729121817627337104338573405363502758051310664021633268414376730467201407009106225068020163387897959773237819305728262319287383442723863515441870698829647061097158914185910479043,"Q":78357891208275236627704132844638967505727136897249392050334637565744827651337881645139210846144691383980195959627043801332638404871115228048764535152878932535563715366752817685769039331584155318869945144310164566511368077496914079871127729568934180084552788321059656200580749646177736416497176633404154512399,"Xi":86882326043955128902291758966201254169153327036684852284159457743375650973048,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489040,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_1.json b/test/_ecdsa_fixtures/keygen_data_1.json deleted file mode 100644 index 905e1965..00000000 --- a/test/_ecdsa_fixtures/keygen_data_1.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,"LambdaN":11137956536116728553533500395428451601937907560251152155674472349747393278550902374805203189353102834940517226275198181715825377282693565984672447720733449033718692389263013140561805920219907491342868930367016454981277614770343294598209676941141625911935385402684784009930494717577522158278477998604707443932446572206083755925638902624031405762652181902790017185587634857824480710523500761333532762995781906113380250008829115160537264396132695189297867307554653731355462516355743386611556342349225481687985733438526123072435686256928342633620521607360207158773825605215371733054347127924142497731440082243061219303374,"PhiN":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887864893144412167511851277805248062811525304363805580034371175269715648961421047001522667065525991563812226760500017658230321074528792265390378595734615109307462710925032711486773223112684698450963375971466877052246144871372513856685267241043214720414317547651210430743466108694255848284995462880164486122438606748},"NTildei":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,"H1i":21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,"H2i":16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,"Alpha":19967099213057383204914591612348835331244244684028038021878115815864643573607628386446351499446200880387710860948899185986317102791981062603688749791834556633594205763898348025423391597477151856368277209373438379436740859320397192190507622036448297319546108508134334691866409509968257127952443932908574529240100673892633092982611976133212375618143746338838773295112497685320322825353865957846712093476995952276628750116582462083820106500643909892067084214142544462317455756985566169802527472194331626964146495919323915789852196739767934502128834813237756300773459124426930549694672300612745005157289225829046350443320,"Beta":3351475445362306343544843146465370022135133221365325506584021437514696447073948607326649530719303449337110205011702282653904760204797540060923677589194216826915473649054874657459548099182316245009334179128713393579774696758223949311450143727953182778076964590579175143090049021134409185976574232660134615307018089813779265641779151263093689588776610320635622357442436913826502155254236496975201392693152798104129408586377602168061032332931385558367833233595526966450052507688984376025229783175162471263401610881203556925958631613068118667831049588152512008911378119398081162801501653098448083895244508503980932329304,"P":67540229384891656651844409391875278535805971140948327835825253518964040924956630563890483414254434230996384170513874345556138744209300641536643162668879213350019072855562559031148859513968109053200459482678466700805056671295718307762574867288867804899308020037617336551287471091739602493683556348162668608519,"Q":82454239773489890482601504410068018479564035393091640688098690156904828618963259497168181955828501964425440407700511627488548564722308038651058595482447426110786974964277667568243088724411005453927224207936026176937488326060322043068958665413144464233716704135283671792628564920677513466392685342003840554273,"Xi":13421620875548478783685264280130319540279412396204581856067409123990702149827,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489041,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_2.json b/test/_ecdsa_fixtures/keygen_data_2.json deleted file mode 100644 index 5587d69c..00000000 --- a/test/_ecdsa_fixtures/keygen_data_2.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,"LambdaN":12420174977816159768311836730868502614606980910361058805906914825990452582769684498532625303826496390788057476364690369033348910630370844412471907376472448255946775272702176019420549055565394588459229953771843514900476425975252868226750526399534255439005673214064922572894193821907072960548814583613552687379309538427375607008218775816300776187253059782533723985373842578966416587039402171269391160038210734265338283579700935300307821195483456552169694400094669193456808849319380040981741270689036563708586105601750505972144644064560987505643057593076017807661075223397694172234464164248776409258536386052322074034722,"PhiN":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758619076854751214016437551632601552374506119565067447970747685157932833174078804342538782320076421468530676567159401870600615642390966913104339388800189338386913617698638760081963482541378073127417172211203501011944289288129121975011286115186152035615322150446795388344468928328497552818517072772104644148069444},"NTildei":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,"H1i":24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,"H2i":23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,"Alpha":17655234602770014706164981089031841683665803713932271722226797850226403995605541927692042640477641853463934810471638522690893118776942115965508831824078878274643089359138444086268807471114070221974326455554609460391587567561452191188243374650196796601849689889308227931995508911996301774738967035270322644410869733878456201891181129502121100168142146902942570932980726113126040739996443147449216612643223593370740309431549523547806898610508891955228214945361645474072676835320321662102868905894918372384225929497183230772035361573090638376749181605205505644969098549520935639405513795519466715171518273403001255077534,"Beta":1309703992022386183165993611366698039449427997366875639642677914951475221706823907699531135899378187345137248297716904194268204335922721510524184991509397615986404123812573854358437132930247316356255184788924935840515918099950130558424419903531643188876592420074187576524199587854261107593534067385965752399264845325260630893466709729776645784697678440777548173162016716442271527476508936523209308425504140835331887100060704271531181980383511620454596886380121860761894353523147348318148768028622355078055829353812198370994269990245609043478214679588655122686060531080442547691456489719416560149574599779497560540397,"P":75849894948976779735347811939983015358289701126129485530833575638336304057010228332753800003317076858576053749984240160808411262136532418035140646497137957027824646024782114246539581261706784164938926475111434750861757561016413917646100377165571797647126429477575305126842368487434225673773435238865330583191,"Q":81873382858150608270974344284366386586127885545529476425867785086174424391770284159998006978012455060242544956686506427859425032442988226529216027806950232752988031386429251427253121570173368239879150645596570395648059029809193584933987659800072813676205404224713952106143112830045808188056678954224735838871,"Xi":60512905083058102828317541363604535052000985569246545178344131423159529650473,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489042,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_3.json b/test/_ecdsa_fixtures/keygen_data_3.json deleted file mode 100644 index c422830f..00000000 --- a/test/_ecdsa_fixtures/keygen_data_3.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,"LambdaN":14749134019728161134791321632275369692524233013649779621809893296266483861419164743680072713641016673341420535980038784139535988273241282670491934117734071621260103564461008387216244962391506137562022368020062826970338541417071565123962100237373787684161492582175722302053952889270470318521461752951207663377582502103612481679785546903497737092646739718960228414265188637047734145789306900359930169567199430246932252502336754769449073545604399775563911963240361092178555640732059795193562526225136853498531215651426232467222597225811005278632409943793343072699662530148246780134904253559119203425983273951025936799894,"PhiN":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755165004207224963359571093806995474185293479437920456828530377274095468291578613800719860339134398860493864505004673509538898147091208799551127823926480722184357111281464119590387125052450273706997062431302852464934445194451622010557264819887586686145399325060296493560269808507118238406851966547902051873599788},"NTildei":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,"H1i":5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,"H2i":12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,"Alpha":11081657114302456905870238988700697319013086504514564717236045074111040270304721782262331797984252430691614068426017510955596726899195967257641174051208447703882084156250584889240095839005540489467495466401970938403346310247408556036689673665093871891298278435521624411505856307364696833164454575973504991622932285895551488556698850552346748171487933151897577939283303629805730794147946617342888218890447001725177619174876097488369727361791975676947593405865072809062942723273440763204434923600873531172534099494752733497463358209835051487344378604418153554063652737193195450363545532848418139118981255680730409512302,"Beta":6133618768796464642689127515841048603411678929048778887613183176733039223632781164469940532922927050017454407346388433982561059238874619156613764279538965805673999228182638980502231563434018778187561992484787389835733891936858821475338920262499782730107803586747101358654454935407337606947979613696034362388794178650615595301000673099802733126135747201458187852101946940145561403001819310752033044230595465371102376558670969498011525356932006598952421270622613251538649383121137336620394892312906550249450594313264381654471011359671967757794187070240886905186497395375837255241953831108789430500495617110587991996301,"P":84941379864152377210242225669264928317159691023194829254645679421740159925217588488952731004823868067983217061306123974421276127010516998676073136283299748376146263706853914037515593018335875604894543863897435289335816332576362867540441313891331099562100108503252946793135736355468080534347347538840570426873,"Q":86819486823245648518546333616113738580382590297427091187534930385584889538907177152831946012667038269320227368381411095041391216367702051211421278756687574403676284605154750830098843999500879487839364193328511641171985228555687462016996858882423932999028361743472217958832728717882760916905455608389887530339,"Xi":112364089429167805612617605207935992851480482276735837868384461499363971980649,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489043,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_ecdsa_fixtures/keygen_data_4.json b/test/_ecdsa_fixtures/keygen_data_4.json deleted file mode 100644 index 18cb0d35..00000000 --- a/test/_ecdsa_fixtures/keygen_data_4.json +++ /dev/null @@ -1 +0,0 @@ -{"PaillierSK":{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909,"LambdaN":10149093216141134311501202950455404687819176108086655763439604876480308509005707752643443490458618682510036223990629323106173886175808296385044425686609452723084562797838400278366168111004894806650750910866618953798107499258689071481984957080631269921080772038916003912601845292072638787648449945124210960193914018453695854880781837335825176626684108716554580184283106556375591277128203617610174489949801946092341366958926118470264594116818761747017074162145794842957429280265435208677184352505170289174058848977955649818405678539344168643684878526539427706898487745565489565051297576919224296053356462767289289048302,"PhiN":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920387828036907391709761563674671650353253368217433109160368566213112751182554256407235220348979899603892184682733917852236940529188233637523494034148324291589685914858560530870417354368705010340578348117697955911299636811357078688337287369757053078855413796975491130979130102595153838448592106712925534578578096604},"NTildei":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909,"H1i":10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086,"H2i":10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921,"Alpha":8408470366230859983977089538380478977860826149489270454328069810654084975083526226901867967245101445604571410949184545806928848367496171695394490975680846096634659990572323984820874886556257679931369017546549426466636628349373434997535608357940850445740802672383001880942463774530857927596978058783287301574862650725916147886368087160144762544419662590752259939290502852152727675096647163487732198989142657556168211955697058551142360575384090048479907050673982511530357975733217486777543581646450398451190583984687224318655106759391236664029406648481857463190935034432818853948222748318559468062943056824704555449134,"Beta":1303581335756818709421881975179134242612051404487234919118951297997660912428946258874173450732466789964747275306227797921668519566246362883156545301727424652513857244895781110573586456845694327439680577390423603690354697165953336606634079302141662711178549256693383664872891160740523114376721120632255979366322575486090138921729381641635562008106350557695734541957078782962609079805469896014721289596075409223805019540244135461060563931165741325239147345553359517505411917435173817689525339060326714858182445353359473248514583063577451167780766715584898979803068848470341681729319284132561683099925112706032837788499,"P":70918676441702109847941825406161441598283607001708097764858825813492644009393784504292475652140532803920770131474422539758167085973762754473428906984187924773864860081926502586255610884224453115958082171309978978480769791086885257435170494368296494175633666482581964523282134040193158752887483912891606190001,"Q":71554446059664415649780061358007915967510424668040620898060829298683302856506794370674269725120058631352920707934286386144057997114398163450073057739596962373649591611826122138174635638077115626791220393282974257688218706979970561095686984927785021971551537923086586996462080307486196415763996110139649834151,"Xi":53183084676561391713014470804436785085880338239597555543583236211085867646018,"ShareID":113038845747912721207165998687304646804841145453205162578867752060711934489044,"Ks":[113038845747912721207165998687304646804841145453205162578867752060711934489040,113038845747912721207165998687304646804841145453205162578867752060711934489041,113038845747912721207165998687304646804841145453205162578867752060711934489042,113038845747912721207165998687304646804841145453205162578867752060711934489043,113038845747912721207165998687304646804841145453205162578867752060711934489044],"NTildej":[21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513,22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333,24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569,29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213,20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909],"H1j":[10412413224774146967586433318565663993332801928342713833153549395804418385612665042848121846642295214487369954020617293624581777516625825058627290504783662751290214117721530559379261855888842859603811581877391207373000303193700272456397052039088367529199893859123832756255017323851446996095283716844351123913629064018545963968706178300696342885264820248576870785977073307280607926366969999975737488222514785353593506468927776986559566328823109809799039061095547328404749040370790285148045725841837287878202567143373484818326900672224770475000627277226340333013385970579819713004257515183340249233682446024347789077890,21112081660720233954802225004609533281837429068867459700250884915814323473310531892136859086275279698011958773983747694939494066504193084701601789391710183189163718240625865130633398724893925801017181806231510410307603510971618549111090838521819913622260743682771094799459598257019310710839649892119214972319616955796340975265383801098929939029384244008130598191089265153008907871402580665908162886234375083905876529421329356722781816730842330541870552986032601685599286558233621076461718214992877407784316734446194662609546064788668982270577567572735972653683896627052713028604350086545679121890217667625999794290284,24824829731918331350012985174920207491589244968880207165666974908064082565753378880139278122375492911941433480410700313757432448065896997973272683586358598750122873935359474796349451660086179792696148018509615367040406896619142592854350581217803150275820150852727372838363675097419616994150396844951998772786254885764645237536687167655847087686690479174416069618852306855253322166155764380201565513533813019490734795757708164664845824206175634760535444169454535163324392065096010976720427339034158158225048446208032460950485467434321303391794597050550017208730729493234419282911470732941744013098156376324281042920598,5052204926684476984373960261154375143416623150904439141396430451934731597669832967728711578970305037336792174764739352101023200471867493684284075215064726876947526283618370303295405938154349649618467009902560143147073816374748100049160197243003019267705628292670033977147217287631139508163238652059845106406601850690410398390830015556930550965050443024062336153142865232523085664801476674097585788277050564769986733913227841304594879268380458544756019393290684971859196564743334135746961097239518905855518738676191314178624481397822201223119676303871041229102566978383106924907219698592577044041810361167324353881660,10678945559528860292581406097357235943626737894833675883513577137569086393781229783926616755163333841705648514571537302318986791312958595503583343615697523248900924457606176241278233897117920086935843926662576737885580123251854984161865984780180443588840587327874921205882037075373373670862922323317355365883845767628546963452971627464028645879899728109874172004488024553571271516681490091086788624567174826591051437418655484210138238999378924287945420571430118779639440958081585142245388045805354979802111230759038871462622913247300585926358814347894299815616307001894062671876185257539939192164764033565266071809086],"H2j":[6208681844962581334768774684269195934681213972470084598700847004046890383946717426391322333902120956544617331110340195788308582016980029098361717644987578924627611887445984265220127773790306545751234760778870726707732108382184678223024598518604539601892715515498356535544726723143625137776732712567546454839416784117330115708917423704225928802494339498629654814492069428510917693498486132362156930689735157189109671585943578531112260277392173069647567182125268161178906487187848583444751144375203856115110667745316690166553420791641619052030236816644793747100669022099974188090308731180744157219000287696406777288080,16252622425198083352025987507494580521255622325275131019147129919585249952644489664990573146629899945826442538364663298759641454002351990938494282059054964094347491880570928863087795784304523415793252497025243326389430823731308795599878510672292022811672889707459286884854181723753481805446591319540483309754691364183693874830660720872543812186365711384829364453616159970874018166849124736659232977288546046350505718292731169419325370131923040703174181627741974843267799355586397246222384883277341697994663377459264244022939308370614516088662412214304850390675249420529621859860685235427895175748411861335962589461230,23828288325622356101673923660332273977529561595167374925496976523211855390482507126843877830612563155501408775303075246595974462031143785502159168279805132448673976266498730078173034183489086718977766082941607664530125708578798418580453096926893486443543441456765079194378602359523395232587700153701250793965324518736397607997104508480680758984395139054968522180939929761523238806520161236482314927672896835749679019071697112158364626166745330154701671352930818340542548430752995811934547580890678933233932026810140289660798243020993743072824497461612790735688454196744865895187544118537129346886856863871458805301807,12929399044892369913584186549588550610224436929306734634729105931065150818745787753469138226151280089607057187719254479974028897021039519209115363240578780198048886198681825875974523002195628438655620398230554390752553021407304722819594805309790762427827914918120363731255035705821866236347429664882520964434307375931980506432569469694814659986064216509489221138811516359576369397784346147988639133446884000315477559725363725818750963991846831961715267763183983611800134601158223259486822535977038243335875888236742164654486611815325702589312404816218593594934131935531097244601847177468766939793434069541632546790312,10743104654796942486599700604186472879307454793870877709208057458642470064020053362780344677808046662809857566462904422831501530962446238270091806504549923131083127288826455511772807878917432732989533653024788394964688490026561835200860162061700941471060869924989775148432669665007160236735323991829044273351425494734068626158843287752707291502501864117887160272500564507448959399177858942168357325970291267719213364706398281565825917500027187648966873712744862795739554464617234545081813214149038386860326064215154933165653534469797705235659466249208165914703842137708303720800465087863064121705881881426344353528921],"BigXj":[{"Curve":"secp256k1","Coords":[34003278891933606736095817458228408609630718934091285807690878956538481535746,17328637328618817314548413210661732206460511838641163882790861907865072127388]},{"Curve":"secp256k1","Coords":[108917598978050039600479804110713566792153083170636174281304021623953452570539,9630937646551347466373985241815936641147856477494908320386682061986834059852]},{"Curve":"secp256k1","Coords":[70770081044908785353163039643335687689683714913479424613592668227454952844848,114062022015097978195444398199017308843470711717616584395878074727271296359148]},{"Curve":"secp256k1","Coords":[84248702126938925156695325589993805156522153066481308435039821349004377185801,51012289756040533156046965744524439746410514132408967865987814473789322177299]},{"Curve":"secp256k1","Coords":[36809207579949412415118043572092501413226291290207838677772055081832365060128,47309454589123462928080622032176412720176387272544559118165460657436675495421]}],"PaillierPKs":[{"N":21624137665787320599285909706522424600282835912314044414602975038903590227326946158008731533402743279325725745397810931044340218892016640378438193506490167007617700451757368700041401844087268622989481100703213661408316150021489854773335909003018297506666186616067410750469804993455912031399952295955502924568843845368741994636021931117172457826497403403240798383414927053760182723099310244298699402597566729129776379529385049936259240040308416709970215754080896602138457838805668725133566387821101155040180180614776215235927802999037549924259897965395532348739669257434587777073245631825288610255343614745132822599513},{"N":22275913072233457107067000790856903203875815120502304311348944699494786557101804749610406378706205669881034452550396363431650754565387131969344895441466898067437384778526026281123611840439814982685737860734032909962555229540686589196419353882283251823870770805369568019860989435155044316556955997209414887865193133350484274945546697075666698119335103818648114308223117603000699160134841302789182856731729684617604149174087002267163903410128607738971138131411960741632537128351167226421896581175209192390226834258281231900356462508568765968904110280124438855813700658776545482796526327873119227383032647866455456932333},{"N":24840349955632319536623673461737005229213961820722117611813829651980905165539368997065250607652992781576114952729380738066697821260741688824943814752944896511893550545404352038841098111130789176918459907543687029800952851950505736453501052799068510878011346428129845145788387643814145921097629167227105374758934523410365468792450195945050251178394954738410765894661087879381854630976365367524285934039080532368313764572743363777951314980125954393468102148797514766475243053461182813311067947041833432226808365444917022237308921310773190016446291260083324837968814114199966858934899291132512886240733000490824280913569},{"N":29498268039456322269582643264550739385048466027299559243619786592532967722838329487360145427282033346682841071960077568279071976546482565340983868235468143242520207128922016774432489924783012275124044736040125653940677082834143130247924200474747575368322985164351444604107905778540940637042923505902415326755508525940599759411028670925566231519088564000561700669414738493710118390506863332003429693169380673168471393864048579677823481777965237650902812756560696829916756378088136920122353926485947217182530247417304358795460797573886111216379696233134196210521582000789943889773745437264940089754472154196512789514213},{"N":20298186432282268623002405900910809375638352216173311526879209752960617018011415505286886980917237365020072447981258646212347772351616592770088851373218905446169125595676800556732336222009789613301501821733237907596214998517378142963969914161262539842161544077832007825203690584145277575296899890248421920388112983152394442812559118445178691968499805496448657805892052422975534447988208392970282470654125075055230115596669654792333638399813845329881152253739159460209887463918375666803229198054943715833616303085097206109149334074822048924431472011671018446091345899942316233142083582533807302444015885580641090144909}],"ECDSAPub":{"Curve":"secp256k1","Coords":[34616392162531332552661326751915484780203302534806544244995484600166780377088,85950902780831064983556176737250601030702822318641577285823028690895242077281]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_0.json b/test/_eddsa_fixtures/keygen_data_Edwards_0.json deleted file mode 100644 index 4d1601d1..00000000 --- a/test/_eddsa_fixtures/keygen_data_Edwards_0.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":7105808523625428964759423666854551422596090594583987980505846034450582466514,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038533,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_1.json b/test/_eddsa_fixtures/keygen_data_Edwards_1.json deleted file mode 100644 index b8b5bfbd..00000000 --- a/test/_eddsa_fixtures/keygen_data_Edwards_1.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":2216525522515784517964725114221640359762439686454275896305189035784864889792,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038534,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_2.json b/test/_eddsa_fixtures/keygen_data_Edwards_2.json deleted file mode 100644 index bb448be5..00000000 --- a/test/_eddsa_fixtures/keygen_data_Edwards_2.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":6798805106169397120784711413352223126177177410429886385878008545729134605226,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038535,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_3.json b/test/_eddsa_fixtures/keygen_data_Edwards_3.json deleted file mode 100644 index 115011e0..00000000 --- a/test/_eddsa_fixtures/keygen_data_Edwards_3.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":6378636119921742345273009438160311240126071047751004237220402687712483110838,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038536,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_Edwards_4.json b/test/_eddsa_fixtures/keygen_data_Edwards_4.json deleted file mode 100644 index e3b3db3e..00000000 --- a/test/_eddsa_fixtures/keygen_data_Edwards_4.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":956018563772820191429619188645904701609120598417629450332371461734910406628,"ShareID":108528794239448683193924371791881655405297675890930491678607226639791233038537,"Ks":[108528794239448683193924371791881655405297675890930491678607226639791233038533,108528794239448683193924371791881655405297675890930491678607226639791233038534,108528794239448683193924371791881655405297675890930491678607226639791233038535,108528794239448683193924371791881655405297675890930491678607226639791233038536,108528794239448683193924371791881655405297675890930491678607226639791233038537],"BigXj":[{"Curve":"ed25519","Coords":[14688462016191664907928382348224472290139697518782490476251712297415310333151,53892578285401737776390265142901453638195083100386885580826237804468756440142]},{"Curve":"ed25519","Coords":[28527654217992643924955964403071056429166673159532231390021561906029105109671,22031525721883669873318068832738753366392667062532668525785947154393427146117]},{"Curve":"ed25519","Coords":[55354871576337763461228816098037277512233007904424959516881752827059109903861,5194029445216369857349552836685891959037161919381169920764348328229886119288]},{"Curve":"ed25519","Coords":[37984443878131374055487672884595992394246413387281109237189203306062727011064,30129610867327463244153430608334489075140525714205360743839376253566322619367]},{"Curve":"ed25519","Coords":[6000798575787352158923282385030950640561591615199218874845810932890176147062,33785208028166402462851075327050157570470196135528143729709029199667766080268]}],"EDDSAPub":{"Curve":"ed25519","Coords":[20117456567872802639380650038515150729713485200167683068172596671241536811181,43035966117053906466416534927769306972239367406667481633778943676234272191053]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_0.json b/test/_eddsa_fixtures/keygen_data_S256_0.json deleted file mode 100644 index 8a2214e1..00000000 --- a/test/_eddsa_fixtures/keygen_data_S256_0.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":36356306466761377653043531869380763147764809259286290231952243620647992665401,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923031,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_1.json b/test/_eddsa_fixtures/keygen_data_S256_1.json deleted file mode 100644 index 14ab9aad..00000000 --- a/test/_eddsa_fixtures/keygen_data_S256_1.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":6285294431335926611510652419499636672688217546979244226495132049262495974204,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923032,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_2.json b/test/_eddsa_fixtures/keygen_data_S256_2.json deleted file mode 100644 index 70c3458e..00000000 --- a/test/_eddsa_fixtures/keygen_data_S256_2.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":93427477359914264470005838856114957964432074204607935278895437010562654215987,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923033,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_3.json b/test/_eddsa_fixtures/keygen_data_S256_3.json deleted file mode 100644 index e3a8304b..00000000 --- a/test/_eddsa_fixtures/keygen_data_S256_3.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":66198676777864000381387121161850911317321250674022554623942832221512144402076,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923034,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file diff --git a/test/_eddsa_fixtures/keygen_data_S256_4.json b/test/_eddsa_fixtures/keygen_data_S256_4.json deleted file mode 100644 index 6d5d8890..00000000 --- a/test/_eddsa_fixtures/keygen_data_S256_4.json +++ /dev/null @@ -1 +0,0 @@ -{"Xi":40390981922501329769225484345395404584193311234298006644242480823629128026808,"ShareID":37208325770245346330106267822931983008961439121035959035649191249389651923035,"Ks":[37208325770245346330106267822931983008961439121035959035649191249389651923031,37208325770245346330106267822931983008961439121035959035649191249389651923032,37208325770245346330106267822931983008961439121035959035649191249389651923033,37208325770245346330106267822931983008961439121035959035649191249389651923034,37208325770245346330106267822931983008961439121035959035649191249389651923035],"BigXj":[{"Curve":"secp256k1","Coords":[29495056138975997926039592492235963881236181192902503622615371348086849662475,34300007735465498074002720953485680427002110426212045249777512226830169197046]},{"Curve":"secp256k1","Coords":[72749290637276147784854666297256959880221644209040713167146010226791065483360,17449495023355799842397853529258139315669492179390615477585320540241390856119]},{"Curve":"secp256k1","Coords":[54874293853943269851754240194883038385150780522539822262698967138542798579731,5749426961777508369262665916051471367656461008216474162088452548227795644460]},{"Curve":"secp256k1","Coords":[85795441141310060624616495884562265890188299530403079661975231081897435595162,69778733934283761969080316278037310149855766492033308107429206780754340012231]},{"Curve":"secp256k1","Coords":[60610596817829701682888871265914992436558926490081587153929142605142183788378,108232638584781695027705696083205485267948455663542277709129333344730698744793]}],"EDDSAPub":{"Curve":"secp256k1","Coords":[6637341870659743023278538591773421940532729408822421026802288628108245004721,33295058271129636573107788993679489925557844144504889892398451022855353366557]}} \ No newline at end of file From 7fbb47aa0cfa354a4b1d82e53df81ad083076b3e Mon Sep 17 00:00:00 2001 From: creamwhip Date: Fri, 28 Jan 2022 15:01:13 +0800 Subject: [PATCH 18/33] gitignore test fixtures dirs --- .gitignore | 2 ++ test/_ecdsa_fixtures/.gitkeep | 0 test/_eddsa_fixtures/.gitkeep | 0 3 files changed, 2 insertions(+) create mode 100644 test/_ecdsa_fixtures/.gitkeep create mode 100644 test/_eddsa_fixtures/.gitkeep diff --git a/.gitignore b/.gitignore index 85908b8a..f38bfd7b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ benchdata *.swp .vscode/*.json +# Test fixtures +./test/*fixtures/*.json diff --git a/test/_ecdsa_fixtures/.gitkeep b/test/_ecdsa_fixtures/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test/_eddsa_fixtures/.gitkeep b/test/_eddsa_fixtures/.gitkeep new file mode 100644 index 00000000..e69de29b From 32a4ad2d767d330d6a97e2a181ac32ce7a39ddc5 Mon Sep 17 00:00:00 2001 From: Gustavo Frederico Date: Fri, 28 Jan 2022 16:20:38 -0500 Subject: [PATCH 19/33] Exposing lock and unlock functions in party. Avoiding race condition in eddsa keygen unit test. --- eddsa/keygen/local_party_test.go | 2 ++ tss/party.go | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index 29bce406..ed854b28 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -301,8 +301,10 @@ keygen: if j2 == j { continue } + P.Lock() vssMsgs := P.temp.kgRound2Message1s share := vssMsgs[j].Content().(*KGRound2Message1).Share + P.Unlock() shareStruct := &vss.Share{ Threshold: threshold, ID: P.PartyID().KeyInt(), diff --git a/tss/party.go b/tss/party.go index 3c4b3b15..d97b37ad 100644 --- a/tss/party.go +++ b/tss/party.go @@ -34,8 +34,8 @@ type Party interface { setRound(Round) *Error Round() Round advance() - lock() - unlock() + Lock() + Unlock() } type BaseParty struct { @@ -49,8 +49,8 @@ func (p *BaseParty) Running() bool { } func (p *BaseParty) WaitingFor() []*PartyID { - p.lock() - defer p.unlock() + p.Lock() + defer p.Unlock() if p.rnd == nil { return []*PartyID{} } @@ -101,19 +101,19 @@ func (p *BaseParty) advance() { p.rnd = p.rnd.NextRound() } -func (p *BaseParty) lock() { +func (p *BaseParty) Lock() { p.mtx.Lock() } -func (p *BaseParty) unlock() { +func (p *BaseParty) Unlock() { p.mtx.Unlock() } // ----- // func BaseStart(p Party, task string, prepare ...func(Round) *Error) *Error { - p.lock() - defer p.unlock() + p.Lock() + defer p.Unlock() if p.PartyID() == nil || !p.PartyID().ValidateBasic() { return p.WrapError(fmt.Errorf("could not start. this party has an invalid PartyID: %+v", p.PartyID())) } @@ -147,10 +147,10 @@ func BaseUpdate2(p Party, msg ParsedMessage, task string) (ok bool, err *Error) } // lock the mutex. need this mtx unlock hook; L108 is recursive so cannot use defer r := func(ok bool, err *Error) (bool, *Error) { - p.unlock() + p.Unlock() return ok, err } - p.lock() // data is written to P state below + p.Lock() // data is written to P state below common.Logger.Debugf("party %s received message: %s", p.PartyID(), msg.String()) if p.Round() != nil { common.Logger.Debugf("party %s round %d update: %s", p.PartyID(), p.Round().RoundNumber(), msg.String()) @@ -174,7 +174,7 @@ func BaseUpdate2(p Party, msg ParsedMessage, task string) (ok bool, err *Error) // finished! the round implementation will have sent the data through the `end` channel. common.Logger.Infof("party %s: %s finished!", p.PartyID(), task) } - p.unlock() // recursive so can't defer after return + p.Unlock() // recursive so can't defer after return return BaseUpdate2(p, msg, task) // re-run round update or finish) } return r(true, nil) @@ -190,10 +190,10 @@ func BaseUpdate(p Party, msg ParsedMessage, task string) (ok bool, err *Error) { } // lock the mutex. need this mtx unlock hook; L108 is recursive so cannot use defer r := func(ok bool, err *Error) (bool, *Error) { - p.unlock() + p.Unlock() return ok, err } - p.lock() // data is written to P state below + p.Lock() // data is written to P state below if p.Round() != nil { common.Logger.Debugf("party %s BaseUpdate round %d update. msg: %s", p.PartyID(), p.Round().RoundNumber(), msg.String()) } @@ -217,7 +217,7 @@ func BaseUpdate(p Party, msg ParsedMessage, task string) (ok bool, err *Error) { // finished! the round implementation will have sent the data through the `end` channel. common.Logger.Infof("party %s: %s finished!", p.PartyID(), task) } - p.unlock() // recursive so can't defer after return + p.Unlock() // recursive so can't defer after return return BaseUpdate(p, msg, task) // re-run round update or finish) } return r(true, nil) From 3a7d0bf6f911d4e56184c351cb00f70d89f72fed Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 13:49:01 +0800 Subject: [PATCH 20/33] fix .gitignore for test fixtures --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f38bfd7b..ab3a5668 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ benchdata .vscode/*.json # Test fixtures -./test/*fixtures/*.json +test/*fixtures/*.json From 8488daf9f1d8c6356fd7271f5dfb14ec2a0811b2 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 15:35:34 +0800 Subject: [PATCH 21/33] upgrade to latest github.com/Roasbeef/btcd BIP340 branch, upgrade deps --- cmd/tss-benchsign/main.go | 6 +-- common/signature.pb.go | 2 +- crypto/ckd/child_key_derivation.go | 33 ++++++++-------- crypto/ckd/child_key_derivation_test.go | 2 +- crypto/ecpoint.go | 26 +++++++++---- crypto/ecpoint_test.go | 8 ++-- ecdsa/keygen/ecdsa-keygen.pb.go | 2 +- ecdsa/resharing/ecdsa-resharing.pb.go | 2 +- ecdsa/signing/ecdsa-signing.pb.go | 2 +- ecdsa/signing/key_derivation_test.go | 22 ++++------- ecdsa/signing/key_derivation_util.go | 14 ++----- ecdsa/signing/local_party_test.go | 4 +- eddsa/keygen/eddsa-keygen.pb.go | 2 +- eddsa/keygen/local_party_test.go | 15 ++++---- eddsa/resharing/eddsa-resharing.pb.go | 2 +- eddsa/resharing/local_party_test.go | 7 ++-- eddsa/signing/eddsa-signing.pb.go | 2 +- eddsa/signing/round_1.go | 5 --- eddsa/signing/utils.go | 15 +++----- go.mod | 25 ++++++------ go.sum | 51 +++++++++++++------------ tss/message.pb.go | 2 +- 22 files changed, 117 insertions(+), 132 deletions(-) diff --git a/cmd/tss-benchsign/main.go b/cmd/tss-benchsign/main.go index 11a0302c..65027ed1 100644 --- a/cmd/tss-benchsign/main.go +++ b/cmd/tss-benchsign/main.go @@ -18,7 +18,7 @@ import ( "github.com/binance-chain/tss-lib/ecdsa/signing" "github.com/binance-chain/tss-lib/test" "github.com/binance-chain/tss-lib/tss" - "github.com/btcsuite/btcd/btcec" + "github.com/decred/dcrd/dcrec/secp256k1/v2" "github.com/ipfs/go-log" "github.com/olekukonko/tablewriter" "github.com/pkg/errors" @@ -196,8 +196,8 @@ outer: ); !ok { panic("ECDSA signature verification did not pass") } - btcecSig := &btcec.Signature{R: r, S: s} - if ok = btcecSig.Verify(msg.Bytes(), (*btcec.PublicKey)(&pk)); !ok { + btcecSig := secp256k1.NewSignature(r, s) + if ok = btcecSig.Verify(msg.Bytes(), (*secp256k1.PublicKey)(&pk)); !ok { panic("ECDSA signature verification 2 did not pass") } break outer diff --git a/common/signature.pb.go b/common/signature.pb.go index 320e1d84..72a1fbcc 100644 --- a/common/signature.pb.go +++ b/common/signature.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/signature.proto package common diff --git a/crypto/ckd/child_key_derivation.go b/crypto/ckd/child_key_derivation.go index c906d302..6d7d8932 100644 --- a/crypto/ckd/child_key_derivation.go +++ b/crypto/ckd/child_key_derivation.go @@ -4,7 +4,6 @@ package ckd import ( "bytes" - "crypto/ecdsa" "crypto/elliptic" "crypto/hmac" "crypto/rand" @@ -17,13 +16,13 @@ import ( "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcutil/base58" "golang.org/x/crypto/ripemd160" ) type ExtendedKey struct { - ecdsa.PublicKey + *btcec.PublicKey Depth uint8 ChildIndex uint32 ChainCode []byte // 32 bytes @@ -71,7 +70,7 @@ func (k *ExtendedKey) String() string { serializedBytes = append(serializedBytes, k.ParentFP...) serializedBytes = append(serializedBytes, childNumBytes[:]...) serializedBytes = append(serializedBytes, k.ChainCode...) - pubKeyBytes := serializeCompressed(k.PublicKey.X, k.PublicKey.Y) + pubKeyBytes := serializeCompressed(k.PublicKey.X(), k.PublicKey.Y()) serializedBytes = append(serializedBytes, pubKeyBytes...) checkSum := doubleHashB(serializedBytes)[:4] @@ -104,23 +103,21 @@ func NewExtendedKeyFromString(key string, curve elliptic.Curve) (*ExtendedKey, e chainCode := payload[13:45] keyData := payload[45:78] - var pubKey ecdsa.PublicKey - - if c, ok := curve.(*btcec.KoblitzCurve); ok { + var pubKey *btcec.PublicKey + if _, ok := curve.(*btcec.KoblitzCurve); ok { // Ensure the public key parses correctly and is actually on the // secp256k1 curve. - pk, err := btcec.ParsePubKey(keyData, c) + pk, err := btcec.ParsePubKey(keyData) if err != nil { return nil, err } - pubKey = ecdsa.PublicKey(*pk) + pubKey = pk } else { + var x, y btcec.FieldVal px, py := elliptic.Unmarshal(curve, keyData) - pubKey = ecdsa.PublicKey{ - Curve: curve, - X: px, - Y: py, - } + x.SetByteSlice(px.Bytes()) + y.SetByteSlice(py.Bytes()) + pubKey = btcec.NewPublicKey(&x, &y) } return &ExtendedKey{ @@ -207,13 +204,13 @@ func DeriveChildKey(index uint32, pk *ExtendedKey, curve elliptic.Curve) (*big.I return nil, nil, errors.New("cannot derive key beyond max depth") } - cryptoPk, err := crypto.NewECPoint(curve, pk.X, pk.Y) + cryptoPk, err := crypto.NewECPoint(curve, pk.X(), pk.Y()) if err != nil { common.Logger.Error("error getting pubkey from extendedkey") return nil, nil, err } - pkPublicKeyBytes := serializeCompressed(pk.X, pk.Y) + pkPublicKeyBytes := serializeCompressed(pk.X(), pk.Y()) data := make([]byte, 37) copy(data, pkPublicKeyBytes) @@ -247,7 +244,7 @@ func DeriveChildKey(index uint32, pk *ExtendedKey, curve elliptic.Curve) (*big.I } childPk := &ExtendedKey{ - PublicKey: *childCryptoPk.ToECDSAPubKey(), + PublicKey: childCryptoPk.ToSecp256k1PubKey(), Depth: pk.Depth + 1, ChildIndex: index, ChainCode: childChainCode, @@ -257,6 +254,8 @@ func DeriveChildKey(index uint32, pk *ExtendedKey, curve elliptic.Curve) (*big.I return ilNum, childPk, nil } +// GenerateSeed +// TODO: Is this being used? func GenerateSeed(length uint8) ([]byte, error) { // Per [BIP32], the seed must be in range [MinSeedBytes, MaxSeedBytes]. if length < MinSeedBytes || length > MaxSeedBytes { diff --git a/crypto/ckd/child_key_derivation_test.go b/crypto/ckd/child_key_derivation_test.go index b1aa12b3..59d09318 100644 --- a/crypto/ckd/child_key_derivation_test.go +++ b/crypto/ckd/child_key_derivation_test.go @@ -10,7 +10,7 @@ import ( "testing" . "github.com/binance-chain/tss-lib/crypto/ckd" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" ) func TestPublicDerivation(t *testing.T) { diff --git a/crypto/ecpoint.go b/crypto/ecpoint.go index c642f74a..fa5019cc 100644 --- a/crypto/ecpoint.go +++ b/crypto/ecpoint.go @@ -18,6 +18,8 @@ import ( "github.com/binance-chain/tss-lib/tss" "github.com/btcsuite/btcd/btcec/v2" + "github.com/decred/dcrd/dcrec/edwards/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v4" ) // ECPoint convenience helper @@ -59,20 +61,28 @@ func (p *ECPoint) ScalarMult(k *big.Int) *ECPoint { return newP } -func (p *ECPoint) ToECDSAPubKey() *ecdsa.PublicKey { - return &ecdsa.PublicKey{ - Curve: p.curve, - X: p.X(), - Y: p.Y(), - } +func (p *ECPoint) ToBtcecPubKey() *btcec.PublicKey { + var x, y btcec.FieldVal + x.SetByteSlice(p.X().Bytes()) + y.SetByteSlice(p.Y().Bytes()) + return btcec.NewPublicKey(&x, &y) } -func (p *ECPoint) ToBtcecPubKey() *btcec.PublicKey { +func (p *ECPoint) ToSecp256k1PubKey() *secp256k1.PublicKey { var x, y btcec.FieldVal x.SetByteSlice(p.X().Bytes()) y.SetByteSlice(p.Y().Bytes()) + return secp256k1.NewPublicKey(&x, &y) +} - return btcec.NewPublicKey(&x, &y) +func (p *ECPoint) ToEdwardsPubKey() *edwards.PublicKey { + ecdsaPK := ecdsa.PublicKey{ + Curve: p.curve, + X: p.X(), + Y: p.Y(), + } + pk := edwards.PublicKey(ecdsaPK) + return &pk } func (p *ECPoint) IsOnCurve() bool { diff --git a/crypto/ecpoint_test.go b/crypto/ecpoint_test.go index 3d79f7d0..8d4f821a 100644 --- a/crypto/ecpoint_test.go +++ b/crypto/ecpoint_test.go @@ -13,7 +13,7 @@ import ( "reflect" "testing" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" "github.com/decred/dcrd/dcrec/edwards/v2" "github.com/stretchr/testify/assert" @@ -126,10 +126,10 @@ func TestS256EcpointJsonSerialization(t *testing.T) { pubKeyBytes, err := hex.DecodeString("03935336acb03b2b801d8f8ac5e92c56c4f6e93319901fdfffba9d340a874e2879") assert.NoError(t, err) - pbk, err := btcec.ParsePubKey(pubKeyBytes, btcec.S256()) + pbk, err := btcec.ParsePubKey(pubKeyBytes) assert.NoError(t, err) - point, err := NewECPoint(ec, pbk.X, pbk.Y) + point, err := NewECPoint(ec, pbk.X(), pbk.Y()) assert.NoError(t, err) bz, err := json.Marshal(point) assert.NoError(t, err) @@ -144,7 +144,7 @@ func TestS256EcpointJsonSerialization(t *testing.T) { } func TestEdwardsEcpointJsonSerialization(t *testing.T) { - ec := edwards.Edwards() + ec := tss.Edwards() tss.RegisterCurve("ed25519", ec) pubKeyBytes, err := hex.DecodeString("ae1e5bf5f3d6bf58b5c222088671fcbe78b437e28fae944c793897b26091f249") diff --git a/ecdsa/keygen/ecdsa-keygen.pb.go b/ecdsa/keygen/ecdsa-keygen.pb.go index 590d33b3..800d1461 100644 --- a/ecdsa/keygen/ecdsa-keygen.pb.go +++ b/ecdsa/keygen/ecdsa-keygen.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/ecdsa-keygen.proto package keygen diff --git a/ecdsa/resharing/ecdsa-resharing.pb.go b/ecdsa/resharing/ecdsa-resharing.pb.go index 904504cb..a527c83e 100644 --- a/ecdsa/resharing/ecdsa-resharing.pb.go +++ b/ecdsa/resharing/ecdsa-resharing.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/ecdsa-resharing.proto package resharing diff --git a/ecdsa/signing/ecdsa-signing.pb.go b/ecdsa/signing/ecdsa-signing.pb.go index 3dc2ea8a..3cc996ce 100644 --- a/ecdsa/signing/ecdsa-signing.pb.go +++ b/ecdsa/signing/ecdsa-signing.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/ecdsa-signing.proto package signing diff --git a/ecdsa/signing/key_derivation_test.go b/ecdsa/signing/key_derivation_test.go index 749514e1..bf6ee342 100644 --- a/ecdsa/signing/key_derivation_test.go +++ b/ecdsa/signing/key_derivation_test.go @@ -10,7 +10,6 @@ import ( "sync/atomic" "testing" - "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" "github.com/binance-chain/tss-lib/common" @@ -39,12 +38,7 @@ func TestHDKeyDerivation(t *testing.T) { assert.NotNil(t, keys[0].ECDSAPub, "the first ECDSA public key must not be null") // build ecdsa key pair - parentPkX, parentPkY := keys[0].ECDSAPub.X(), keys[0].ECDSAPub.Y() - pk := ecdsa.PublicKey{ - Curve: tss.EC(), - X: parentPkX, - Y: parentPkY, - } + pk := keys[0].ECDSAPub.ToSecp256k1PubKey() // setting the chain code to a random positive number smaller than the maximum allowed of 32 bytes chainCode := make([]byte, 32) @@ -66,7 +60,7 @@ func TestHDKeyDerivation(t *testing.T) { keyDerivationDelta := il - err = UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta, keys, &extendedChildPk.PublicKey, tss.EC()) + err = UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta, keys, extendedChildPk.PublicKey, tss.EC()) assert.NoErrorf(t, err, "there should not be an error setting the derived keys") // PHASE: signing @@ -117,7 +111,6 @@ signing: bigRX, bigRY := parties[0].temp.BigR.X(), parties[0].temp.BigR.Y() bigR := crypto.NewECPointNoCurveCheck(tss.EC(), bigRX, bigRY) - r := parties[0].temp.Rx // fmt.Printf("sign result: R(%s, %s), r=%s\n", bigR.X().String(), bigR.Y().String(), r.String()) modN := common.ModInt(tss.EC().Params().N) @@ -130,13 +123,14 @@ signing: // fmt.Printf("S: %s\n", sumS.String()) // END check s correctness - ok := ecdsa.Verify(&extendedChildPk.PublicKey, msg.Bytes(), bigR.X(), sumS) + ecdsaPK := &ecdsa.PublicKey{ + Curve: tss.EC(), + X: extendedChildPk.X(), + Y: extendedChildPk.Y(), + } + ok := ecdsa.Verify(ecdsaPK, msg.Bytes(), bigR.X(), sumS) assert.True(t, ok, "ecdsa verify must pass") - btcecSig := &btcec.Signature{R: r, S: sumS} - btcecSig.Verify(msg.Bytes(), (*btcec.PublicKey)(&extendedChildPk.PublicKey)) - assert.True(t, ok, "ecdsa verify 2 must pass") - t.Log("ECDSA signing test done.") // END ECDSA verify diff --git a/ecdsa/signing/key_derivation_util.go b/ecdsa/signing/key_derivation_util.go index e6192d98..f1ba3920 100644 --- a/ecdsa/signing/key_derivation_util.go +++ b/ecdsa/signing/key_derivation_util.go @@ -3,7 +3,6 @@ package signing import ( - "crypto/ecdsa" "crypto/elliptic" "math/big" @@ -12,14 +11,15 @@ import ( "github.com/binance-chain/tss-lib/crypto/ckd" "github.com/binance-chain/tss-lib/ecdsa/keygen" "github.com/btcsuite/btcd/chaincfg" + "github.com/decred/dcrd/dcrec/secp256k1/v4" ) func UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta *big.Int, keys []keygen.LocalPartySaveData, - extendedChildPk *ecdsa.PublicKey, ec elliptic.Curve) error { + extendedChildPk *secp256k1.PublicKey, ec elliptic.Curve) error { var err error gDelta := crypto.ScalarBaseMult(ec, keyDerivationDelta) for k := range keys { - keys[k].ECDSAPub, err = crypto.NewECPoint(ec, extendedChildPk.X, extendedChildPk.Y) + keys[k].ECDSAPub, err = crypto.NewECPoint(ec, extendedChildPk.X(), extendedChildPk.Y()) if err != nil { common.Logger.Errorf("error creating new extended child public key") return err @@ -39,12 +39,7 @@ func UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta *big.Int, keys []keygen.Lo func derivingPubkeyFromPath(masterPub *crypto.ECPoint, chainCode []byte, path []uint32, ec elliptic.Curve) (*big.Int, *ckd.ExtendedKey, error) { // build ecdsa key pair - pk := ecdsa.PublicKey{ - Curve: ec, - X: masterPub.X(), - Y: masterPub.Y(), - } - + pk := masterPub.ToSecp256k1PubKey() net := &chaincfg.MainNetParams extendedParentPk := &ckd.ExtendedKey{ PublicKey: pk, @@ -54,6 +49,5 @@ func derivingPubkeyFromPath(masterPub *crypto.ECPoint, chainCode []byte, path [] ParentFP: []byte{0x00, 0x00, 0x00, 0x00}, Version: net.HDPrivateKeyID[:], } - return ckd.DeriveChildKeyFromHierarchy(path, extendedParentPk, ec.Params().N, ec) } diff --git a/ecdsa/signing/local_party_test.go b/ecdsa/signing/local_party_test.go index f6538148..c499176e 100644 --- a/ecdsa/signing/local_party_test.go +++ b/ecdsa/signing/local_party_test.go @@ -21,7 +21,7 @@ import ( "github.com/binance-chain/tss-lib/crypto/paillier" zkpdec "github.com/binance-chain/tss-lib/crypto/zkp/dec" zkplogstar "github.com/binance-chain/tss-lib/crypto/zkp/logstar" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" @@ -188,7 +188,7 @@ func TestE2EWithHDKeyDerivation(t *testing.T) { keyDerivationDelta := il - err = UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta, keys, &extendedChildPk.PublicKey, btcec.S256()) + err = UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta, keys, extendedChildPk.PublicKey, btcec.S256()) assert.NoErrorf(t, err, "there should not be an error setting the derived keys") // PHASE: signing diff --git a/eddsa/keygen/eddsa-keygen.pb.go b/eddsa/keygen/eddsa-keygen.pb.go index fd8ec69c..0b4afd81 100644 --- a/eddsa/keygen/eddsa-keygen.pb.go +++ b/eddsa/keygen/eddsa-keygen.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/eddsa-keygen.proto package keygen diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index ed854b28..0be1b11e 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -15,18 +15,17 @@ import ( "sync/atomic" "testing" - "github.com/btcsuite/btcd/btcec/v2" - "github.com/btcsuite/btcd/btcec/v2/schnorr" - "github.com/decred/dcrd/dcrec/edwards/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v2" - "github.com/ipfs/go-log" - "github.com/stretchr/testify/assert" - "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" "github.com/binance-chain/tss-lib/crypto/vss" "github.com/binance-chain/tss-lib/test" "github.com/binance-chain/tss-lib/tss" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/decred/dcrd/dcrec/edwards/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v4/schnorr" + "github.com/ipfs/go-log" + "github.com/stretchr/testify/assert" ) const ( @@ -387,7 +386,7 @@ keygen: } signature, err := schnorr.Sign(sk, data) assert.NoError(t, err, "sign should not throw an error") - ok := signature.Verify(data, save.EDDSAPub.ToBtcecPubKey()) + ok := signature.Verify(data, save.EDDSAPub.ToSecp256k1PubKey()) assert.True(t, ok, "signature should be ok") t.Log("EdDSA signing test done.") diff --git a/eddsa/resharing/eddsa-resharing.pb.go b/eddsa/resharing/eddsa-resharing.pb.go index edcfdcb1..c5790b46 100644 --- a/eddsa/resharing/eddsa-resharing.pb.go +++ b/eddsa/resharing/eddsa-resharing.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/eddsa-resharing.proto package resharing diff --git a/eddsa/resharing/local_party_test.go b/eddsa/resharing/local_party_test.go index ef999f70..c7e4dc78 100644 --- a/eddsa/resharing/local_party_test.go +++ b/eddsa/resharing/local_party_test.go @@ -25,10 +25,9 @@ import ( ) const ( - testParticipants = test.TestParticipants - testThreshold = test.TestThreshold - testSetIdS256Schnorr = "S256" - testSetIdEdwards = "Edwards" + testParticipants = test.TestParticipants + testThreshold = test.TestThreshold + testSetIdEdwards = "Edwards" ) func setUp(level string) { diff --git a/eddsa/signing/eddsa-signing.pb.go b/eddsa/signing/eddsa-signing.pb.go index 94343b6c..ed3887be 100644 --- a/eddsa/signing/eddsa-signing.pb.go +++ b/eddsa/signing/eddsa-signing.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/eddsa-signing.proto package signing diff --git a/eddsa/signing/round_1.go b/eddsa/signing/round_1.go index e176da5a..e6ea4339 100644 --- a/eddsa/signing/round_1.go +++ b/eddsa/signing/round_1.go @@ -9,7 +9,6 @@ package signing import ( "errors" "fmt" - "math/big" "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" @@ -18,10 +17,6 @@ import ( "github.com/binance-chain/tss-lib/tss" ) -var ( - zero = big.NewInt(0) -) - // round 1 represents round 1 of the signing part of the EDDSA TSS spec func newRound1(params *tss.Parameters, key *keygen.LocalPartySaveData, data *common.SignatureData, temp *localTempData, out chan<- tss.Message, end chan<- common.SignatureData) tss.Round { return &round1{ diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index cb5b3489..f91584c4 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -16,9 +16,9 @@ import ( "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" "github.com/btcsuite/btcd/btcec/v2" - "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/decred/dcrd/dcrec/secp256k1/v4" + "github.com/decred/dcrd/dcrec/secp256k1/v4/schnorr" ) func encodedBytesToBigInt(s *[32]byte) *big.Int { @@ -138,15 +138,15 @@ func OddY(a *crypto.ECPoint) bool { } func SchnorrVerify(p *btcec.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { - var r btcec.FieldVal - var s btcec.ModNScalar + var r secp256k1.FieldVal + var s secp256k1.ModNScalar r.SetByteSlice(r_.Bytes()) s.SetByteSlice(s_.Bytes()) err := schnorrVerify(m, p, r, s) return err == nil } -func schnorrVerify(hash []byte, pub *btcec.PublicKey, sigR btcec.FieldVal, sigS btcec.ModNScalar) error { +func schnorrVerify(hash []byte, pubKey *btcec.PublicKey, sigR secp256k1.FieldVal, sigS secp256k1.ModNScalar) error { // The algorithm for producing a BIP-340 signature is described in // README.md and is reproduced here for reference: // @@ -175,11 +175,6 @@ func schnorrVerify(hash []byte, pub *btcec.PublicKey, sigR btcec.FieldVal, sigS // for verification always has an even y-coordinate. So we'll serialize // it, then parse it again to esure we only proceed with points that // have an even y-coordinate. - pubKey, err := ParsePubKey(pub.SerializeCompressed()[1:]) - if err != nil { - return err - } - pubKey = pub // extra // Step 2. // @@ -306,7 +301,7 @@ func ParsePubKey(pubKeyStr []byte) (*btcec.PublicKey, error) { // We'll manually prepend the compressed byte so we can re-use the // existing pubkey parsing routine of the main btcec package. var keyCompressed [btcec.PubKeyBytesLenCompressed]byte - keyCompressed[0] = btcec.PubKeyFormatCompressedEven + keyCompressed[0] = secp256k1.PubKeyFormatCompressedEven copy(keyCompressed[1:], pubKeyStr) return btcec.ParsePubKey(keyCompressed[:]) diff --git a/go.mod b/go.mod index 5c9fd548..d3bd586a 100644 --- a/go.mod +++ b/go.mod @@ -4,47 +4,44 @@ go 1.17 require ( github.com/agl/ed25519 v0.0.0-20200305024217-f36fc4b53d43 - github.com/btcsuite/btcd v0.22.0-beta - github.com/btcsuite/btcd/btcec/v2 v2.0.0-00010101000000-000000000000 + github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c + github.com/btcsuite/btcd/btcec/v2 v2.0.0 github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 - github.com/golang/protobuf v1.5.2 github.com/hashicorp/go-multierror v1.1.1 github.com/ipfs/go-log v1.0.5 - github.com/olekukonko/tablewriter v0.0.4 + github.com/olekukonko/tablewriter v0.0.5 github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.7.0 - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 - golang.org/x/text v0.3.6 + golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed + golang.org/x/text v0.3.7 google.golang.org/protobuf v1.27.1 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/chaincfg/chainhash v1.0.2 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/ipfs/go-log/v2 v2.4.0 // indirect + github.com/ipfs/go-log/v2 v2.5.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mattn/go-runewidth v0.0.7 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rivo/uniseg v0.2.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect - go.uber.org/zap v1.19.1 // indirect - golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 // indirect + go.uber.org/zap v1.20.0 // indirect + golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) replace github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 -replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20211206001652-70ae843c3628 - -replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20211206001652-70ae843c3628 +replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb diff --git a/go.sum b/go.sum index 23dbdcb9..82d46a53 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,16 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Roasbeef/btcd v0.0.0-20211206001652-70ae843c3628 h1:wxLzzEUuL9uqxSC3xZXDYRsR68qeMyqGgtiGft0CiZs= -github.com/Roasbeef/btcd v0.0.0-20211206001652-70ae843c3628/go.mod h1:soto1+lhdAeyw3o8yvHDREjF974Os5rjySL0Axwvztg= -github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20211206001652-70ae843c3628 h1:VcF+CVdEHANTqpoAGfbvf38rYyYyX/me2+IOvH2M1f0= -github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20211206001652-70ae843c3628/go.mod h1:5jOpKsF5fx4TqK0bnERSkf0umFmewBznJy82ji0rAgQ= +github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb h1:iiJ9fLbB/sG4MGNAOAi6DoezeasH2+Hnv/HN4lMMeu8= +github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:vkwesBkYQtKXFYQYi9PyahtopbX53Tvk/O/qp2WI6Gk= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:Vkf7rtHx8uHx8gDfkQaCdVfc+gfrF9v6sR6xJy7RXNg= github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:TnVqVdGEK8b6erOMkcyYGWzCQMw7HEMCOw3BgFYCFWs= +github.com/btcsuite/btcd/btcec/v2 v2.0.0 h1:mOmhmxiH7xffFCF7Hv+NawRozdoOT1SRv77YUEMHMM0= +github.com/btcsuite/btcd/btcec/v2 v2.0.0/go.mod h1:vu+77Lro3alBlmsmlDnkZtgGiNo6OBwMHSb1XTGDwGo= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd h1:vAwk2PCYxzUUGAXXtw66PyY2IMCwWBnm8GR5aLIxS3Q= github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= @@ -47,8 +46,6 @@ github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -60,8 +57,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-log/v2 v2.4.0 h1:iR/2o9PGWanVJrBgIH5Ff8mPGOwpqLaPIAFqSnsdlzk= -github.com/ipfs/go-log/v2 v2.4.0/go.mod h1:nPZnh7Cj7lwS3LpRU5Mwr2ol1c2gXIEXuF6aywqrtmo= +github.com/ipfs/go-log/v2 v2.5.0 h1:+MhAooFd9XZNvR0i9FriKW6HB0ql7HNXUuflWtc0dd4= +github.com/ipfs/go-log/v2 v2.5.0/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -74,12 +71,13 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= -github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -97,6 +95,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -113,26 +113,27 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= +go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed h1:YoWVYYAfvQ4ddHv3OKmIvX7NCAhFGTj62VP2l2kfBbA= +golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -147,6 +148,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -162,16 +164,19 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 h1:A0Qkn7Z/n8zC1xd9LTw17AiKlBRK64tw3ejWQiEqca0= -golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -191,8 +196,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tss/message.pb.go b/tss/message.pb.go index 2e515a84..dc787987 100644 --- a/tss/message.pb.go +++ b/tss/message.pb.go @@ -7,7 +7,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.18.1 +// protoc v3.19.3 // source: protob/message.proto package tss From 68d2ee89ce121b36406dfaf39e1afa396a6934c0 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 19:09:24 +0800 Subject: [PATCH 22/33] Makefile: remove sleeps --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index 2137529a..9ecf8dac 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,6 @@ test_unit_level0: @echo "--> Running Unit Tests - Level 0" @echo "!!! WARNING: This will take a long time :)" @echo "!!! WARNING: This will delete fixtures :(" - sleep 10 go clean -testcache rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json @@ -53,7 +52,6 @@ test_unit_level0: test_unit: test_unit_level0 @echo "--> Running Unit Tests - Level 1" @echo "!!! WARNING: This will take a long time :)" - sleep 2 go test -timeout 60m $(UT_PACKAGES_LEVEL_1) test_unit_race_level0: @@ -61,7 +59,6 @@ test_unit_race_level0: @echo "!!! WARNING: This will take a long time :)" @echo "!!! WARNING: This will delete fixtures :(" go clean -testcache - sleep 10 rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json go test -timeout 50m -race $(UT_PACKAGES_LEVEL_0) @@ -69,7 +66,6 @@ test_unit_race_level0: test_unit_race: test_unit_race_level0 @echo "--> Running Unit Tests (with Race Detection) - Level 1" @echo "!!! WARNING: This will take a long time :)" - sleep 2 go test -timeout 60m -race $(UT_PACKAGES_LEVEL_1) test: From a916c493d16deeee9844053e11a26c0de3172274 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 20:29:07 +0800 Subject: [PATCH 23/33] use schnorr verify from Roasbeef's btcd fork --- eddsa/signing/utils.go | 207 +---------------------------------------- go.mod | 4 +- go.sum | 8 +- 3 files changed, 10 insertions(+), 209 deletions(-) diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index f91584c4..2d0e0efd 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -8,17 +8,14 @@ package signing import ( "crypto/elliptic" - "encoding/hex" - "fmt" "math/big" "github.com/agl/ed25519/edwards25519" "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/crypto" "github.com/btcsuite/btcd/btcec/v2" - "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/decred/dcrd/dcrec/secp256k1/v4" - "github.com/decred/dcrd/dcrec/secp256k1/v4/schnorr" ) func encodedBytesToBigInt(s *[32]byte) *big.Int { @@ -86,7 +83,6 @@ func ecPointToEncodedBytes(x *big.Int, y *big.Int) *[32]byte { } else { s[31] &^= (1 << 7) } - return s } @@ -142,203 +138,6 @@ func SchnorrVerify(p *btcec.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool var s secp256k1.ModNScalar r.SetByteSlice(r_.Bytes()) s.SetByteSlice(s_.Bytes()) - err := schnorrVerify(m, p, r, s) - return err == nil -} - -func schnorrVerify(hash []byte, pubKey *btcec.PublicKey, sigR secp256k1.FieldVal, sigS secp256k1.ModNScalar) error { - // The algorithm for producing a BIP-340 signature is described in - // README.md and is reproduced here for reference: - // - // 1. Fail if m is not 32 bytes - // 2. P = lift_x(int(pk)). - // 3. r = int(sig[0:32]); fail is r >= p. - // 4. s = int(sig[32:64]); fail if s >= n. - // 5. e = int(tagged_hash("BIP0340/challenge", bytes(r) || bytes(P) || M)) mod n. - // 6. R = s*G - e*P - // 7. Fail if is_infinite(R) - // 8. Fail if not hash_even_y(R) - // 9. Fail is x(R) != r. - // 10. Return success iff not failure occured before reachign this - // point. - - // Step 1. - // - // Fail if m is not 32 bytes - if len(hash) != 32 { - str := fmt.Sprintf("wrong size for message (got %v, want %v)", - len(hash), 32) - return schnorr.Error{Err: schnorr.ErrorKind("ErrInvalidHashLen"), Description: str} - } - - // Before we proceed, we want to ensure that the public key we're using - // for verification always has an even y-coordinate. So we'll serialize - // it, then parse it again to esure we only proceed with points that - // have an even y-coordinate. - - // Step 2. - // - // Fail if Q is not a point on the curve - if !pubKey.IsOnCurve() { - str := "pubkey point is not on curve" - return schnorr.Error{Err: schnorr.ErrorKind("ErrPubKeyNotOnCurve"), Description: str} - } - - // Step 3. - // - // Fail if r >= p - // - // Note this is already handled by the fact r is a field element. - - // Step 4. - // - // Fail if s >= n - // - // Note this is already handled by the fact s is a mod n scalar. - - // Step 5. - // - // e = int(tagged_hash("BIP0340/challenge", bytes(r) || bytes(P) || M)) mod n. - var rBytes [32]byte - sigR.PutBytesUnchecked(rBytes[:]) - pBytes := pubKey.SerializeCompressed() - - logBytes("finalize schnorrVerify - ", rBytes[:], pBytes[1:], hash) - common.Logger.Debugf("finalize schnorrVerify - sigR: %v", sigR.String()) - commitment := chainhash.TaggedHash( - []byte("BIP0340/challenge"), rBytes[:], pBytes[1:], hash, - ) - - var e btcec.ModNScalar - if overflow := e.SetBytes((*[32]byte)(commitment)); overflow != 0 { - str := "hash of (r || P || m) too big" - return schnorr.Error{Err: schnorr.ErrorKind("ErrSchnorrHashValue"), Description: str} - } - - common.Logger.Debugf("finalize schnorrVerify - e: %v", e.String()) - - // Negate e here so we can use AddNonConst below to subtract the s*G - // point from e*P. - e.Negate() - - // Step 6. - // - // R = s*G - e*P - var P, R, sG, eP btcec.JacobianPoint - pubKey.AsJacobian(&P) - btcec.ScalarBaseMultNonConst(&sigS, &sG) - btcec.ScalarMultNonConst(&e, &P, &eP) - - var _sGAffine btcec.JacobianPoint - _sGAffine.X, _sGAffine.Y, _sGAffine.Z = sG.X, sG.Y, sG.Z - _sGAffine.ToAffine() - - var _ePAffine btcec.JacobianPoint - _ePAffine.X, _ePAffine.Y, _ePAffine.Z = eP.X, eP.Y, eP.Z - _ePAffine.ToAffine() - common.Logger.Debugf("finalize - (minus)e: %v, P: %v, _sGAffine: %v, -ePAffine: %v", e.String(), - JacobianPointToString(P), - JacobianPointToString(_sGAffine), - JacobianPointToString(_ePAffine)) - btcec.AddNonConst(&sG, &eP, &R) - - // Step 7. - // - // Fail if R is the point at infinity - if (R.X.IsZero() && R.Y.IsZero()) || R.Z.IsZero() { - str := "calculated R point is the point at infinity" - return schnorr.Error{Err: schnorr.ErrorKind("ErrSigRNotOnCurve"), Description: str} - } - - // Step 8. - // - // Fail if R.y is odd - // - // Note that R must be in affine coordinates for this check. - R.ToAffine() - common.Logger.Debugf("finalize - R (calculated) (after affine): %v", JacobianPointToString(R)) - if R.Y.IsOdd() { - str := "calculated R y-value is odd" - return schnorr.Error{Err: schnorr.ErrorKind("ErrSigRYIsOdd"), Description: str} - } - - // Step 9. - // - // Verified if R.x == r - // - // Note that R must be in affine coordinates for this check. - common.Logger.Debugf("sigR: %s, R.X (calculated): %s", sigR.String(), R.X.String()) - if !sigR.Equals(&R.X) { - str := "calculated R point was not given R" - return schnorr.Error{Err: schnorr.ErrorKind("ErrUnequalRValues"), Description: str} - } - - // Step 10. - // - // Return success iff not failure occured before reachign this - return nil -} - -func logBytes(logMsg string, r, p, h []byte) { - common.Logger.Debugf("%s r: %s, p: %s, h: %s", logMsg, hex.EncodeToString(r), hex.EncodeToString(p), hex.EncodeToString(h)) -} - -func JacobianPointToString(point secp256k1.JacobianPoint) string { - return "[X:" + point.X.String() + ", Y:" + point.Y.String() + ", Z:" + point.Z.String() + "]" -} - -func ParsePubKey(pubKeyStr []byte) (*btcec.PublicKey, error) { - if pubKeyStr == nil { - err := fmt.Errorf("nil pubkey byte string") - return nil, err - } - if len(pubKeyStr) != 32 { - err := fmt.Errorf("bad pubkey byte string size (want %v, have %v)", - 32, len(pubKeyStr)) - return nil, err - } - - // We'll manually prepend the compressed byte so we can re-use the - // existing pubkey parsing routine of the main btcec package. - var keyCompressed [btcec.PubKeyBytesLenCompressed]byte - keyCompressed[0] = secp256k1.PubKeyFormatCompressedEven - copy(keyCompressed[1:], pubKeyStr) - - return btcec.ParsePubKey(keyCompressed[:]) -} - -func RSBytesToBtcec(r_ []byte, s_ []byte) (btcec.FieldVal, btcec.ModNScalar) { - var r btcec.FieldVal - var s btcec.ModNScalar - r.SetByteSlice(r_) - s.SetByteSlice(s_) - return r, s -} - -func RSToSchnorrSignature(r_ *big.Int, s_ *big.Int) *schnorr.Signature { - var r btcec.FieldVal - var s btcec.ModNScalar - r.SetByteSlice(r_.Bytes()) - s.SetByteSlice(s_.Bytes()) - signature := schnorr.NewSignature(&r, &s) - return signature -} - -func RSByesToSchnorrSignature(r_ []byte, s_ []byte) *schnorr.Signature { - var r btcec.FieldVal - var s btcec.ModNScalar - r.SetByteSlice(r_) - s.SetByteSlice(s_) - return schnorr.NewSignature(&r, &s) -} - -func NextPointEvenY(curve elliptic.Curve, P *crypto.ECPoint) (*crypto.ECPoint, int) { - G := crypto.ScalarBaseMult(curve, big.NewInt(1)) - a := 0 - Q := *P - Qptr := &Q - for ; OddY(Qptr); a++ { // Y cannot be odd - Qptr, _ = Qptr.Add(G) - } - return Qptr, a + sig := schnorr.NewSignature(&r, &s) + return sig.Verify(m, p) } diff --git a/go.mod b/go.mod index d3bd586a..2300163f 100644 --- a/go.mod +++ b/go.mod @@ -42,6 +42,8 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 +replace github.com/agl/ed25519 => github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb + +replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222525-3e50557000a9 diff --git a/go.sum b/go.sum index 82d46a53..d580b835 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,13 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb h1:iiJ9fLbB/sG4MGNAOAi6DoezeasH2+Hnv/HN4lMMeu8= github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:vkwesBkYQtKXFYQYi9PyahtopbX53Tvk/O/qp2WI6Gk= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222525-3e50557000a9 h1:Y0bDb3tYW2NysBmmq+pYH2Ct/1NRyzk5lXWD/k4LFvM= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222525-3e50557000a9/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:oJHEIS4MpbHUZP2P+9+bATmf4KQSX/SGwxdVoJKhrEI= +github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:l5lLTZ+iRubuGXG2bs2YcG4EkM2V2jqUOrjQlVDznuo= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:Vkf7rtHx8uHx8gDfkQaCdVfc+gfrF9v6sR6xJy7RXNg= -github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:TnVqVdGEK8b6erOMkcyYGWzCQMw7HEMCOw3BgFYCFWs= -github.com/btcsuite/btcd/btcec/v2 v2.0.0 h1:mOmhmxiH7xffFCF7Hv+NawRozdoOT1SRv77YUEMHMM0= -github.com/btcsuite/btcd/btcec/v2 v2.0.0/go.mod h1:vu+77Lro3alBlmsmlDnkZtgGiNo6OBwMHSb1XTGDwGo= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= From f1aec7611b7d979b7bc18c7b25c8c7e33596f92f Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 20:29:39 +0800 Subject: [PATCH 24/33] .github/workflows: run tests with race detection --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce390a8f..4576e1ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,5 +27,5 @@ jobs: run: go get -v -t -d ./... - name: Run Tests - run: make test_unit + run: make test From 384dc5b44e66b335580ee3943b80db37c51eff35 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 20:43:09 +0800 Subject: [PATCH 25/33] remove dep github.com/decred/dcrd/dcrec/secp256k1/v2 --- cmd/tss-benchsign/main.go | 13 +++++++++---- crypto/ckd/child_key_derivation.go | 2 +- crypto/ecpoint.go | 8 -------- ecdsa/signing/key_derivation_test.go | 2 +- ecdsa/signing/key_derivation_util.go | 6 +++--- eddsa/keygen/local_party_test.go | 13 ++++--------- eddsa/signing/utils.go | 13 ++++++------- go.mod | 5 ++--- go.sum | 8 ++------ 9 files changed, 28 insertions(+), 42 deletions(-) diff --git a/cmd/tss-benchsign/main.go b/cmd/tss-benchsign/main.go index 65027ed1..7a8d722a 100644 --- a/cmd/tss-benchsign/main.go +++ b/cmd/tss-benchsign/main.go @@ -18,7 +18,8 @@ import ( "github.com/binance-chain/tss-lib/ecdsa/signing" "github.com/binance-chain/tss-lib/test" "github.com/binance-chain/tss-lib/tss" - "github.com/decred/dcrd/dcrec/secp256k1/v2" + "github.com/btcsuite/btcd/btcec/v2" + ecdsa2 "github.com/btcsuite/btcd/btcec/v2/ecdsa" "github.com/ipfs/go-log" "github.com/olekukonko/tablewriter" "github.com/pkg/errors" @@ -194,10 +195,14 @@ outer: msg.Bytes(), r, s, ); !ok { - panic("ECDSA signature verification did not pass") + panic("ECDSA signature verification 1 did not pass") } - btcecSig := secp256k1.NewSignature(r, s) - if ok = btcecSig.Verify(msg.Bytes(), (*secp256k1.PublicKey)(&pk)); !ok { + R := new(btcec.ModNScalar) + R.SetByteSlice(r.Bytes()) + S := new(btcec.ModNScalar) + S.SetByteSlice(s.Bytes()) + sig := ecdsa2.NewSignature(R, S) + if ok = sig.Verify(msg.Bytes(), keys[0].ECDSAPub.ToBtcecPubKey()); !ok { panic("ECDSA signature verification 2 did not pass") } break outer diff --git a/crypto/ckd/child_key_derivation.go b/crypto/ckd/child_key_derivation.go index 6d7d8932..981d619e 100644 --- a/crypto/ckd/child_key_derivation.go +++ b/crypto/ckd/child_key_derivation.go @@ -244,7 +244,7 @@ func DeriveChildKey(index uint32, pk *ExtendedKey, curve elliptic.Curve) (*big.I } childPk := &ExtendedKey{ - PublicKey: childCryptoPk.ToSecp256k1PubKey(), + PublicKey: childCryptoPk.ToBtcecPubKey(), Depth: pk.Depth + 1, ChildIndex: index, ChainCode: childChainCode, diff --git a/crypto/ecpoint.go b/crypto/ecpoint.go index fa5019cc..6be63e2a 100644 --- a/crypto/ecpoint.go +++ b/crypto/ecpoint.go @@ -19,7 +19,6 @@ import ( "github.com/binance-chain/tss-lib/tss" "github.com/btcsuite/btcd/btcec/v2" "github.com/decred/dcrd/dcrec/edwards/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v4" ) // ECPoint convenience helper @@ -68,13 +67,6 @@ func (p *ECPoint) ToBtcecPubKey() *btcec.PublicKey { return btcec.NewPublicKey(&x, &y) } -func (p *ECPoint) ToSecp256k1PubKey() *secp256k1.PublicKey { - var x, y btcec.FieldVal - x.SetByteSlice(p.X().Bytes()) - y.SetByteSlice(p.Y().Bytes()) - return secp256k1.NewPublicKey(&x, &y) -} - func (p *ECPoint) ToEdwardsPubKey() *edwards.PublicKey { ecdsaPK := ecdsa.PublicKey{ Curve: p.curve, diff --git a/ecdsa/signing/key_derivation_test.go b/ecdsa/signing/key_derivation_test.go index bf6ee342..b29b0ec2 100644 --- a/ecdsa/signing/key_derivation_test.go +++ b/ecdsa/signing/key_derivation_test.go @@ -38,7 +38,7 @@ func TestHDKeyDerivation(t *testing.T) { assert.NotNil(t, keys[0].ECDSAPub, "the first ECDSA public key must not be null") // build ecdsa key pair - pk := keys[0].ECDSAPub.ToSecp256k1PubKey() + pk := keys[0].ECDSAPub.ToBtcecPubKey() // setting the chain code to a random positive number smaller than the maximum allowed of 32 bytes chainCode := make([]byte, 32) diff --git a/ecdsa/signing/key_derivation_util.go b/ecdsa/signing/key_derivation_util.go index f1ba3920..82f11719 100644 --- a/ecdsa/signing/key_derivation_util.go +++ b/ecdsa/signing/key_derivation_util.go @@ -10,12 +10,12 @@ import ( "github.com/binance-chain/tss-lib/crypto" "github.com/binance-chain/tss-lib/crypto/ckd" "github.com/binance-chain/tss-lib/ecdsa/keygen" + "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg" - "github.com/decred/dcrd/dcrec/secp256k1/v4" ) func UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta *big.Int, keys []keygen.LocalPartySaveData, - extendedChildPk *secp256k1.PublicKey, ec elliptic.Curve) error { + extendedChildPk *btcec.PublicKey, ec elliptic.Curve) error { var err error gDelta := crypto.ScalarBaseMult(ec, keyDerivationDelta) for k := range keys { @@ -39,7 +39,7 @@ func UpdatePublicKeyAndAdjustBigXj(keyDerivationDelta *big.Int, keys []keygen.Lo func derivingPubkeyFromPath(masterPub *crypto.ECPoint, chainCode []byte, path []uint32, ec elliptic.Curve) (*big.Int, *ckd.ExtendedKey, error) { // build ecdsa key pair - pk := masterPub.ToSecp256k1PubKey() + pk := masterPub.ToBtcecPubKey() net := &chaincfg.MainNetParams extendedParentPk := &ckd.ExtendedKey{ PublicKey: pk, diff --git a/eddsa/keygen/local_party_test.go b/eddsa/keygen/local_party_test.go index 0be1b11e..4cd101cb 100644 --- a/eddsa/keygen/local_party_test.go +++ b/eddsa/keygen/local_party_test.go @@ -21,9 +21,8 @@ import ( "github.com/binance-chain/tss-lib/test" "github.com/binance-chain/tss-lib/tss" "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/decred/dcrd/dcrec/edwards/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v2" - "github.com/decred/dcrd/dcrec/secp256k1/v4/schnorr" "github.com/ipfs/go-log" "github.com/stretchr/testify/assert" ) @@ -353,16 +352,12 @@ keygen: // build eddsa key pair pkX, pkY := save.EDDSAPub.X(), save.EDDSAPub.Y() - pk := secp256k1.PublicKey{ - Curve: tss.S256(), - X: pkX, - Y: pkY, - } + pk := save.EDDSAPub.ToBtcecPubKey() sk, _ := btcec.PrivKeyFromBytes(u.Bytes()) // fmt.Println("err: ", err.Error()) // test pub key, should be on curve and match pkX, pkY - assert.True(t, pk.IsOnCurve(pkX, pkY), "public key must be on curve") + assert.True(t, pk.IsOnCurve(), "public key must be on curve") // public key tests assert.NotZero(t, u, "u should not be zero") @@ -386,7 +381,7 @@ keygen: } signature, err := schnorr.Sign(sk, data) assert.NoError(t, err, "sign should not throw an error") - ok := signature.Verify(data, save.EDDSAPub.ToSecp256k1PubKey()) + ok := signature.Verify(data, save.EDDSAPub.ToBtcecPubKey()) assert.True(t, ok, "signature should be ok") t.Log("EdDSA signing test done.") diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index 2d0e0efd..f694f7b8 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -15,7 +15,6 @@ import ( "github.com/binance-chain/tss-lib/crypto" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" - "github.com/decred/dcrd/dcrec/secp256k1/v4" ) func encodedBytesToBigInt(s *[32]byte) *big.Int { @@ -133,11 +132,11 @@ func OddY(a *crypto.ECPoint) bool { return a.Y().Bit(0) > 0 } -func SchnorrVerify(p *btcec.PublicKey, m []byte, r_ *big.Int, s_ *big.Int) bool { - var r secp256k1.FieldVal - var s secp256k1.ModNScalar - r.SetByteSlice(r_.Bytes()) - s.SetByteSlice(s_.Bytes()) - sig := schnorr.NewSignature(&r, &s) +func SchnorrVerify(p *btcec.PublicKey, m []byte, r *big.Int, s *big.Int) bool { + R := new(btcec.FieldVal) + R.SetByteSlice(r.Bytes()) + S := new(btcec.ModNScalar) + S.SetByteSlice(s.Bytes()) + sig := schnorr.NewSignature(R, S) return sig.Verify(m, p) } diff --git a/go.mod b/go.mod index 2300163f..418c19e1 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,6 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.0.0 github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 - github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 github.com/hashicorp/go-multierror v1.1.1 github.com/ipfs/go-log v1.0.5 github.com/olekukonko/tablewriter v0.0.5 @@ -24,6 +22,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/ipfs/go-log/v2 v2.5.0 // indirect @@ -46,4 +45,4 @@ replace github.com/agl/ed25519 => github.com/SwingbyProtocol/edwards25519 v0.0.0 replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb -replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222525-3e50557000a9 +replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb diff --git a/go.sum b/go.sum index d580b835..cf1f80c0 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb h1:iiJ9fLbB/sG4MGNAOAi6DoezeasH2+Hnv/HN4lMMeu8= github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:vkwesBkYQtKXFYQYi9PyahtopbX53Tvk/O/qp2WI6Gk= -github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222525-3e50557000a9 h1:Y0bDb3tYW2NysBmmq+pYH2Ct/1NRyzk5lXWD/k4LFvM= -github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222525-3e50557000a9/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb h1:BIc4awpCV2FjrFHI4fVjNjRVT6olrTvoF5ebpEucdto= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:oJHEIS4MpbHUZP2P+9+bATmf4KQSX/SGwxdVoJKhrEI= github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:l5lLTZ+iRubuGXG2bs2YcG4EkM2V2jqUOrjQlVDznuo= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -31,14 +31,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= -github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 h1:bX7rtGTMBDJxujZ29GNqtn7YCAdINjHKnA6J6tBBv6s= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= -github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY= -github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= From c8e9a99f5594221d3bc5d3e1c722acaf69e49db0 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 20:51:03 +0800 Subject: [PATCH 26/33] eddsa: minor clean ups --- eddsa/signing/finalize.go | 11 ++--------- eddsa/signing/local_party_test.go | 12 ++++++------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/eddsa/signing/finalize.go b/eddsa/signing/finalize.go index 9f4abab9..02694f79 100644 --- a/eddsa/signing/finalize.go +++ b/eddsa/signing/finalize.go @@ -85,20 +85,13 @@ func (round *finalization) Start() *tss.Error { round.data.Signature = append(round.data.R, round.data.S...) if isTwistedEdwardsCurve { - pk := edwards.PublicKey{ - Curve: round.Params().EC(), - X: round.key.EDDSAPub.X(), - Y: round.key.EDDSAPub.Y(), - } common.Logger.Debugf("finalize - r: %v, s:%v", hex.EncodeToString(round.temp.r.Bytes()), hex.EncodeToString(s.Bytes())) - ok = edwards.Verify(&pk, round.temp.m.Bytes(), round.temp.r, s) - if !ok { + if ok = edwards.Verify(round.key.EDDSAPub.ToEdwardsPubKey(), round.temp.m.Bytes(), round.temp.r, s); !ok { return round.WrapError(fmt.Errorf("edwards signature verification failed")) } } else if isSecp256k1Curve { - ok = SchnorrVerify(round.key.EDDSAPub.ToBtcecPubKey(), round.temp.m.Bytes(), round.temp.r, s) - if !ok { + if ok = SchnorrVerify(round.key.EDDSAPub.ToBtcecPubKey(), round.temp.m.Bytes(), round.temp.r, s); !ok { return round.WrapError(fmt.Errorf("schnorr signature verification failed")) } } diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index 0cbc872f..131a34a7 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -176,14 +176,14 @@ func TestE2EConcurrentS256Schnorr(t *testing.T) { updater := test.SharedPartyUpdater - msg_, _ := hex.DecodeString("304502210088BE0644191B935DB1CD786B43FF27798006578D8C908906B49E89") // big.NewInt(200).Bytes() - msg := big.NewInt(0).SetBytes(msg_) + msg, _ := hex.DecodeString("304502210088BE0644191B935DB1CD786B43FF27798006578D8C908906B49E89") // big.NewInt(200).Bytes() + msgI := big.NewInt(0).SetBytes(msg) // init the parties for i := 0; i < len(signPIDs); i++ { params := tss.NewParameters(tss.S256(), p2pCtx, signPIDs[i], len(signPIDs), threshold) - P := NewLocalParty(msg, params, keys[i], outCh, endCh).(*LocalParty) + P := NewLocalParty(msgI, params, keys[i], outCh, endCh).(*LocalParty) parties = append(parties, P) go func(P *LocalParty) { if err := P.Start(); err != nil { @@ -239,9 +239,9 @@ signing: r := new(big.Int).SetBytes(parties[0].data.GetR()) s := new(big.Int).SetBytes(parties[0].data.GetS()) - ok := SchnorrVerify(keys[0].EDDSAPub.ToBtcecPubKey(), msg_, r, s) - - assert.True(t, ok, "eddsa verify must pass") + if ok := SchnorrVerify(keys[0].EDDSAPub.ToBtcecPubKey(), msg, r, s); !assert.True(t, ok, "EdDSA sig must verify") { + return + } t.Log("EdDSA signing test done.") // END EdDSA verify From 004ee6fe843396efd0b0a06e303313dc4762f9cf Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 21:41:04 +0800 Subject: [PATCH 27/33] eddsa: use schnorrVerify with an error return value --- eddsa/signing/finalize.go | 7 +- eddsa/signing/local_party_test.go | 2 +- eddsa/signing/utils.go | 131 ++++++++++++++++++++++++++++-- 3 files changed, 130 insertions(+), 10 deletions(-) diff --git a/eddsa/signing/finalize.go b/eddsa/signing/finalize.go index 02694f79..2ac468a6 100644 --- a/eddsa/signing/finalize.go +++ b/eddsa/signing/finalize.go @@ -17,6 +17,7 @@ import ( "github.com/binance-chain/tss-lib/common" "github.com/binance-chain/tss-lib/tss" "github.com/decred/dcrd/dcrec/edwards/v2" + errors2 "github.com/pkg/errors" ) func (round *finalization) Start() *tss.Error { @@ -91,13 +92,11 @@ func (round *finalization) Start() *tss.Error { return round.WrapError(fmt.Errorf("edwards signature verification failed")) } } else if isSecp256k1Curve { - if ok = SchnorrVerify(round.key.EDDSAPub.ToBtcecPubKey(), round.temp.m.Bytes(), round.temp.r, s); !ok { - return round.WrapError(fmt.Errorf("schnorr signature verification failed")) + if err := SchnorrVerify(round.key.EDDSAPub.ToBtcecPubKey(), round.temp.m.Bytes(), round.temp.r, s); err != nil { + return round.WrapError(errors2.Wrapf(err, "schnorr signature verification failed")) } } - round.end <- *round.data - return nil } diff --git a/eddsa/signing/local_party_test.go b/eddsa/signing/local_party_test.go index 131a34a7..29b436ee 100644 --- a/eddsa/signing/local_party_test.go +++ b/eddsa/signing/local_party_test.go @@ -239,7 +239,7 @@ signing: r := new(big.Int).SetBytes(parties[0].data.GetR()) s := new(big.Int).SetBytes(parties[0].data.GetS()) - if ok := SchnorrVerify(keys[0].EDDSAPub.ToBtcecPubKey(), msg, r, s); !assert.True(t, ok, "EdDSA sig must verify") { + if err2 := SchnorrVerify(keys[0].EDDSAPub.ToBtcecPubKey(), msg, r, s); !assert.NoError(t, err2, "EdDSA sig must verify") { return } t.Log("EdDSA signing test done.") diff --git a/eddsa/signing/utils.go b/eddsa/signing/utils.go index f694f7b8..22c4fed6 100644 --- a/eddsa/signing/utils.go +++ b/eddsa/signing/utils.go @@ -8,6 +8,7 @@ package signing import ( "crypto/elliptic" + "fmt" "math/big" "github.com/agl/ed25519/edwards25519" @@ -15,6 +16,7 @@ import ( "github.com/binance-chain/tss-lib/crypto" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" + "github.com/btcsuite/btcd/chaincfg/chainhash" ) func encodedBytesToBigInt(s *[32]byte) *big.Int { @@ -132,11 +134,130 @@ func OddY(a *crypto.ECPoint) bool { return a.Y().Bit(0) > 0 } -func SchnorrVerify(p *btcec.PublicKey, m []byte, r *big.Int, s *big.Int) bool { - R := new(btcec.FieldVal) +func SchnorrVerify(p *btcec.PublicKey, m []byte, r *big.Int, s *big.Int) error { + var R btcec.FieldVal R.SetByteSlice(r.Bytes()) - S := new(btcec.ModNScalar) + var S btcec.ModNScalar S.SetByteSlice(s.Bytes()) - sig := schnorr.NewSignature(R, S) - return sig.Verify(m, p) + return schnorrVerify(m, p, R, S) +} + +/////////////////////////// + +// signatureError creates an Error given a set of arguments. +func signatureError(kind schnorr.ErrorKind, desc string) schnorr.Error { + return schnorr.Error{Err: kind, Description: desc} +} + +// from https://github.com/Roasbeef/btcd/blob/5a59e7c0ddfb46d1bd7a99b87dbb8f7657a14382/btcec/schnorr/signature.go +// for whatever reason using this code directly yields some issues +func schnorrVerify(hash []byte, pubKey *btcec.PublicKey, r btcec.FieldVal, s btcec.ModNScalar) error { + // The algorithm for producing a BIP-340 signature is described in + // README.md and is reproduced here for reference: + // + // 1. Fail if m is not 32 bytes + // 2. P = lift_x(int(pk)). + // 3. r = int(sig[0:32]); fail is r >= p. + // 4. s = int(sig[32:64]); fail if s >= n. + // 5. e = int(tagged_hash("BIP0340/challenge", bytes(r) || bytes(P) || M)) mod n. + // 6. R = s*G - e*P + // 7. Fail if is_infinite(R) + // 8. Fail if not hash_even_y(R) + // 9. Fail is x(R) != r. + // 10. Return success iff not failure occured before reachign this + // point. + + // Step 1. + // + // Fail if m is not 32 bytes + if len(hash) != 32 { + str := fmt.Sprintf("wrong size for message (got %v, want %v)", len(hash), 32) + return signatureError("ErrInvalidHashLen", str) + } + + // Step 2. + // + // P = lift_x(int(pk)) + // + // Fail if P is not a point on the curve + if !pubKey.IsOnCurve() { + str := "pubkey point is not on curve" + return signatureError("ErrPubKeyNotOnCurve", str) + } + + // Step 3. + // + // Fail if r >= p + // + // Note this is already handled by the fact r is a field element. + + // Step 4. + // + // Fail if s >= n + // + // Note this is already handled by the fact s is a mod n scalar. + + // Step 5. + // + // e = int(tagged_hash("BIP0340/challenge", bytes(r) || bytes(P) || M)) mod n. + var rBytes [32]byte + r.PutBytesUnchecked(rBytes[:]) + pBytes := schnorr.SerializePubKey(pubKey) + + commitment := chainhash.TaggedHash( + []byte("BIP0340/challenge"), rBytes[:], pBytes, hash, + ) + + var e btcec.ModNScalar + if overflow := e.SetBytes((*[32]byte)(commitment)); overflow != 0 { + str := "hash of (r || P || m) too big" + return signatureError("ErrSchnorrHashValue", str) + } + + // Negate e here so we can use AddNonConst below to subtract the s*G + // point from e*P. + e.Negate() + + // Step 6. + // + // R = s*G - e*P + var P, R, sG, eP btcec.JacobianPoint + pubKey.AsJacobian(&P) + btcec.ScalarBaseMultNonConst(&s, &sG) + btcec.ScalarMultNonConst(&e, &P, &eP) + btcec.AddNonConst(&sG, &eP, &R) + + // Step 7. + // + // Fail if R is the point at infinity + if (R.X.IsZero() && R.Y.IsZero()) || R.Z.IsZero() { + str := "calculated R point is the point at infinity" + return signatureError("ErrSigRNotOnCurve", str) + } + + // Step 8. + // + // Fail if R.y is odd + // + // Note that R must be in affine coordinates for this check. + R.ToAffine() + if R.Y.IsOdd() { + str := "calculated R y-value is odd" + return signatureError("ErrSigRYIsOdd", str) + } + + // Step 9. + // + // Verified if R.x == r + // + // Note that R must be in affine coordinates for this check. + if !r.Equals(&R.X) { + str := "calculated R point was not given R" + return signatureError("ErrUnequalRValues", str) + } + + // Step 10. + // + // Return success iff not failure occured before reachign this + return nil } From 1e9891f477409b7a0d5bfe7f28486f132694ba2c Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 21:51:14 +0800 Subject: [PATCH 28/33] move tools (benchgen, benchsign) to their own module --- Makefile | 4 ++-- cmd/go.mod | 17 +++++++++++++ cmd/go.sum | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 4 ---- go.sum | 9 ------- 5 files changed, 89 insertions(+), 15 deletions(-) create mode 100644 cmd/go.mod create mode 100644 cmd/go.sum diff --git a/Makefile b/Makefile index 9ecf8dac..83675cca 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,10 @@ build: protob ### Benchmarking benchgen: fmt - go run ./cmd/tss-benchgen benchdata + cd cmd && go run ./tss-benchgen benchdata benchsign: fmt - go run ./cmd/tss-benchsign benchdata + cd cmd && go run ./tss-benchsign benchdata ######################################## ### Testing diff --git a/cmd/go.mod b/cmd/go.mod new file mode 100644 index 00000000..a2a70471 --- /dev/null +++ b/cmd/go.mod @@ -0,0 +1,17 @@ +module github.com/binance-chain/tss-lib/cmd + +go 1.17 + +require ( + github.com/olekukonko/tablewriter v0.0.5 + golang.org/x/text v0.3.7 +) + +require ( + github.com/binance-chain/tss-lib v1.3.3 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/rivo/uniseg v0.2.0 // indirect + golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e // indirect +) + +replace github.com/binance-chain/tss-lib => github.com/SwingbyProtocol/tss-lib v0.0.0-20211214082003-1bfe24ba5457 diff --git a/cmd/go.sum b/cmd/go.sum new file mode 100644 index 00000000..47efa5e1 --- /dev/null +++ b/cmd/go.sum @@ -0,0 +1,70 @@ +bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/binance-chain/tss-lib v1.3.3 h1:fW9O2ynr4j4apsx/2J39kv/xw/ia23mwmZI4gnmo48c= +github.com/binance-chain/tss-lib v1.3.3/go.mod h1:xfM6gCPA61WIV5q5tK9Acdv46n1QJLhXnZ4eD17hJpI= +github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= +github.com/otiai10/primes v0.0.0-20180210170552-f6d2a1ba97c4/go.mod h1:UmSP7QeU3XmAdGu5+dnrTJqjBc+IscpVZkQzk473cjM= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/go.mod b/go.mod index 418c19e1..5c69db3c 100644 --- a/go.mod +++ b/go.mod @@ -10,12 +10,10 @@ require ( github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 github.com/hashicorp/go-multierror v1.1.1 github.com/ipfs/go-log v1.0.5 - github.com/olekukonko/tablewriter v0.0.5 github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.7.0 golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed - golang.org/x/text v0.3.7 google.golang.org/protobuf v1.27.1 ) @@ -28,11 +26,9 @@ require ( github.com/ipfs/go-log/v2 v2.5.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.20.0 // indirect diff --git a/go.sum b/go.sum index cf1f80c0..02e40a8e 100644 --- a/go.sum +++ b/go.sum @@ -67,13 +67,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -91,8 +86,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -171,8 +164,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= From 0f000a76aaa2678a14ea0b24e385a41a3968d225 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 29 Jan 2022 21:53:14 +0800 Subject: [PATCH 29/33] go mod tidy in cmd tools module --- cmd/go.mod | 30 ++++++++- cmd/go.sum | 189 ++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 177 insertions(+), 42 deletions(-) diff --git a/cmd/go.mod b/cmd/go.mod index a2a70471..601c1c20 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -3,15 +3,39 @@ module github.com/binance-chain/tss-lib/cmd go 1.17 require ( + github.com/binance-chain/tss-lib v1.3.3 + github.com/btcsuite/btcd/btcec/v2 v2.0.0 + github.com/ipfs/go-log v1.0.5 github.com/olekukonko/tablewriter v0.0.5 + github.com/pkg/errors v0.9.1 golang.org/x/text v0.3.7 ) require ( - github.com/binance-chain/tss-lib v1.3.3 // indirect + github.com/agl/ed25519 v0.0.0-20200305024217-f36fc4b53d43 // indirect + github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c // indirect + github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd // indirect + github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/ipfs/go-log/v2 v2.5.0 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 // indirect github.com/rivo/uniseg v0.2.0 // indirect - golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.7.0 // indirect + go.uber.org/zap v1.20.0 // indirect + golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed // indirect + golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect + google.golang.org/protobuf v1.27.1 // indirect ) -replace github.com/binance-chain/tss-lib => github.com/SwingbyProtocol/tss-lib v0.0.0-20211214082003-1bfe24ba5457 +replace github.com/binance-chain/tss-lib => github.com/SwingbyProtocol/tss-lib v1.5.1-0.20220129135114-1e9891f47740 + +replace github.com/agl/ed25519 => github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 + +replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb + +replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb diff --git a/cmd/go.sum b/cmd/go.sum index 47efa5e1..41ef7521 100644 --- a/cmd/go.sum +++ b/cmd/go.sum @@ -1,70 +1,181 @@ -bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb h1:iiJ9fLbB/sG4MGNAOAi6DoezeasH2+Hnv/HN4lMMeu8= +github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:vkwesBkYQtKXFYQYi9PyahtopbX53Tvk/O/qp2WI6Gk= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb h1:BIc4awpCV2FjrFHI4fVjNjRVT6olrTvoF5ebpEucdto= +github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:oJHEIS4MpbHUZP2P+9+bATmf4KQSX/SGwxdVoJKhrEI= +github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:l5lLTZ+iRubuGXG2bs2YcG4EkM2V2jqUOrjQlVDznuo= +github.com/SwingbyProtocol/tss-lib v1.5.1-0.20220129135114-1e9891f47740 h1:ayv/YCZMJCxCAyOlyBq+aXQCMTWXgbaN8iwf3/+uMH4= +github.com/SwingbyProtocol/tss-lib v1.5.1-0.20220129135114-1e9891f47740/go.mod h1:C7dIxMLqVUyn8chxz6dILIUo0o+OMxNQgqhqIy/kUko= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/binance-chain/tss-lib v1.3.3 h1:fW9O2ynr4j4apsx/2J39kv/xw/ia23mwmZI4gnmo48c= -github.com/binance-chain/tss-lib v1.3.3/go.mod h1:xfM6gCPA61WIV5q5tK9Acdv46n1QJLhXnZ4eD17hJpI= -github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd h1:vAwk2PCYxzUUGAXXtw66PyY2IMCwWBnm8GR5aLIxS3Q= +github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 h1:bX7rtGTMBDJxujZ29GNqtn7YCAdINjHKnA6J6tBBv6s= +github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= +github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= +github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= +github.com/ipfs/go-log/v2 v2.5.0 h1:+MhAooFd9XZNvR0i9FriKW6HB0ql7HNXUuflWtc0dd4= +github.com/ipfs/go-log/v2 v2.5.0/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= -github.com/otiai10/primes v0.0.0-20180210170552-f6d2a1ba97c4/go.mod h1:UmSP7QeU3XmAdGu5+dnrTJqjBc+IscpVZkQzk473cjM= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/jsonindent v0.0.0-20171116142732-447bf004320b/go.mod h1:SXIpH2WO0dyF5YBc6Iq8jc8TEJYe1Fk2Rc1EVYUdIgY= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.2 h1:VYWnrP5fXmz1MXvjuUvcBrXSjGE6xjON+axB/UrpO3E= +github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 h1:7x5D/2dkkr27Tgh4WFuX+iCS6OzuE5YJoqJzeqM+5mc= +github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11/go.mod h1:1DmRMnU78i/OVkMnHzvhXSi4p8IhYUmtLJWhyOavJc0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= +go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed h1:YoWVYYAfvQ4ddHv3OKmIvX7NCAhFGTj62VP2l2kfBbA= +golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= From 0397aac048cbc29359bf5ff1377fc088003b4511 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 5 Feb 2022 02:37:28 +0800 Subject: [PATCH 30/33] upgrade btcsuite/btcd and btcsuite/btcd/btcec/v2 --- go.mod | 13 +++++------ go.sum | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 65 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 5c69db3c..778452ea 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.17 require ( github.com/agl/ed25519 v0.0.0-20200305024217-f36fc4b53d43 - github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c - github.com/btcsuite/btcd/btcec/v2 v2.0.0 + github.com/btcsuite/btcd v0.22.0-beta.0.20220201204404-81fbd9b67e54 + github.com/btcsuite/btcd/btcec/v2 v2.1.0 github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd github.com/decred/dcrd/dcrec/edwards/v2 v2.0.2 github.com/hashicorp/go-multierror v1.1.1 @@ -13,7 +13,7 @@ require ( github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.7.0 - golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed + golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 google.golang.org/protobuf v1.27.1 ) @@ -32,13 +32,10 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.20.0 // indirect - golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect + golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) replace github.com/agl/ed25519 => github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 - -replace github.com/btcsuite/btcd => github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb - -replace github.com/btcsuite/btcd/btcec/v2 => github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb diff --git a/go.sum b/go.sum index 02e40a8e..4059aa46 100644 --- a/go.sum +++ b/go.sum @@ -1,22 +1,28 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb h1:iiJ9fLbB/sG4MGNAOAi6DoezeasH2+Hnv/HN4lMMeu8= -github.com/Roasbeef/btcd v0.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:vkwesBkYQtKXFYQYi9PyahtopbX53Tvk/O/qp2WI6Gk= -github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb h1:BIc4awpCV2FjrFHI4fVjNjRVT6olrTvoF5ebpEucdto= -github.com/Roasbeef/btcd/btcec/v2 v2.0.0-20220128222530-5a59e7c0ddfb/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:oJHEIS4MpbHUZP2P+9+bATmf4KQSX/SGwxdVoJKhrEI= github.com/SwingbyProtocol/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:l5lLTZ+iRubuGXG2bs2YcG4EkM2V2jqUOrjQlVDznuo= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.22.0-beta.0.20220201204404-81fbd9b67e54 h1:khJx6kvXopB224O05cs6iwmX/zAh7RlkMf8MiPXVS1I= +github.com/btcsuite/btcd v0.22.0-beta.0.20220201204404-81fbd9b67e54/go.mod h1:vkwesBkYQtKXFYQYi9PyahtopbX53Tvk/O/qp2WI6Gk= +github.com/btcsuite/btcd/btcec/v2 v2.0.0/go.mod h1:vu+77Lro3alBlmsmlDnkZtgGiNo6OBwMHSb1XTGDwGo= +github.com/btcsuite/btcd/btcec/v2 v2.1.0 h1:Whmbo9yShKKG+WrUfYGFfgj77vYBiwhwBSJnM66TMKI= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd h1:vAwk2PCYxzUUGAXXtw66PyY2IMCwWBnm8GR5aLIxS3Q= github.com/btcsuite/btcutil v1.0.3-0.20211129182920-9c4bbabe7acd/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= @@ -25,6 +31,7 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -39,9 +46,21 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -50,11 +69,13 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.5.0 h1:+MhAooFd9XZNvR0i9FriKW6HB0ql7HNXUuflWtc0dd4= github.com/ipfs/go-log/v2 v2.5.0/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -69,8 +90,15 @@ github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= @@ -114,6 +142,7 @@ go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -121,8 +150,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed h1:YoWVYYAfvQ4ddHv3OKmIvX7NCAhFGTj62VP2l2kfBbA= -golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 h1:71vQrMauZZhcTVK6KdYM+rklehEEwb3E+ZhaE5jrPrE= +golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -130,26 +159,37 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -157,11 +197,12 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE= +golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -181,6 +222,12 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= @@ -192,10 +239,14 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= From ce97eecec72b08ffb5eb3c67df0eac6c447214b7 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 5 Feb 2022 05:07:52 +0800 Subject: [PATCH 31/33] Makefile: unit test coverage --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 83675cca..faeb235c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ MODULE = github.com/binance-chain/tss-lib PACKAGES = $(shell go list ./... | grep -v '/vendor/') +UT_TIMEOUT = -timeout 60m +UT_COVER = -covermode=atomic -cover UT_PACKAGES_LEVEL_0 = $(shell go list ./... | grep -v '/vendor/' | grep 'keygen' ) UT_PACKAGES_LEVEL_1 = $(shell go list ./... | grep -v '/vendor/' | grep -v 'keygen' ) @@ -46,13 +48,13 @@ test_unit_level0: go clean -testcache rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json - go test -timeout 50m $(UT_PACKAGES_LEVEL_0) + go test ${UT_TIMEOUT} ${UT_COVER} $(UT_PACKAGES_LEVEL_0) test_unit: test_unit_level0 @echo "--> Running Unit Tests - Level 1" @echo "!!! WARNING: This will take a long time :)" - go test -timeout 60m $(UT_PACKAGES_LEVEL_1) + go test ${UT_TIMEOUT} ${UT_COVER} $(UT_PACKAGES_LEVEL_1) test_unit_race_level0: @echo "--> Running Unit Tests (with Race Detection) - Level 0" @@ -61,12 +63,12 @@ test_unit_race_level0: go clean -testcache rm -f ./test/_ecdsa_fixtures/*json rm -f ./test/_eddsa_fixtures/*json - go test -timeout 50m -race $(UT_PACKAGES_LEVEL_0) + go test -race ${UT_TIMEOUT} ${UT_COVER} $(UT_PACKAGES_LEVEL_0) test_unit_race: test_unit_race_level0 @echo "--> Running Unit Tests (with Race Detection) - Level 1" @echo "!!! WARNING: This will take a long time :)" - go test -timeout 60m -race $(UT_PACKAGES_LEVEL_1) + go test -race ${UT_TIMEOUT} ${UT_COVER} $(UT_PACKAGES_LEVEL_1) test: make test_unit_race From 6fc01c07f2f24c11ab014b7e584519b08dc330d8 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sat, 5 Feb 2022 05:33:51 +0800 Subject: [PATCH 32/33] .github/workflows: use go 1.17 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4576e1ca..8393a2ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: runs-on: macOS-latest steps: - - name: Set up Go 1.16 + - name: Set up Go 1.17 uses: actions/setup-go@v1 with: - go-version: 1.16 + go-version: 1.17 id: go - name: Check out code into the Go module directory From 5f617c7049e71fa0759e7a53aa2d59940d7c2b95 Mon Sep 17 00:00:00 2001 From: creamwhip Date: Sun, 13 Feb 2022 23:00:31 +0800 Subject: [PATCH 33/33] upgrade deps --- go.mod | 6 +++--- go.sum | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 778452ea..ce43f7ca 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/otiai10/primes v0.0.0-20210501021515-f1b2be525a11 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.7.0 - golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 + golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2 google.golang.org/protobuf v1.27.1 ) @@ -31,8 +31,8 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect - go.uber.org/zap v1.20.0 // indirect - golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v2 v2.3.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 4059aa46..7197dbde 100644 --- a/go.sum +++ b/go.sum @@ -142,6 +142,8 @@ go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -152,6 +154,8 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 h1:71vQrMauZZhcTVK6KdYM+rklehEEwb3E+ZhaE5jrPrE= golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2 h1:XdAboW3BNMv9ocSCOk/u1MFioZGzCNkiJZ19v9Oe3Ig= +golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -199,6 +203,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=