From 74d494a136ee8d4784bc229765f10f7519503c60 Mon Sep 17 00:00:00 2001 From: ChihYunChuang Date: Tue, 7 Mar 2023 17:31:34 +0800 Subject: [PATCH 1/2] crypto/bip32: add rid --- crypto/binaryfield/message.pb.go | 2 +- crypto/binaryquadraticform/message.pb.go | 2 +- crypto/bip32/child/message.pb.go | 2 +- crypto/bip32/master/0_initial_handler.go | 11 ++ crypto/bip32/master/5_result_handler.go | 5 +- crypto/bip32/master/6_verify_handler.go | 2 +- crypto/bip32/master/master.go | 2 + crypto/bip32/master/message.pb.go | 155 ++++++++++--------- crypto/bip32/master/message.proto | 1 + crypto/bip32/master/peer.go | 1 + crypto/birkhoffinterpolation/bk.pb.go | 2 +- crypto/circuit/message.pb.go | 2 +- crypto/commitment/message.pb.go | 2 +- crypto/ecpointgrouplaw/point.pb.go | 2 +- crypto/homo/cl/message.pb.go | 2 +- crypto/homo/paillier/message.pb.go | 2 +- crypto/ot/message.pb.go | 2 +- crypto/tss/dkg/message.pb.go | 2 +- crypto/tss/ecdsa/cggmp/dkg/message.pb.go | 2 +- crypto/tss/ecdsa/cggmp/refresh/message.pb.go | 2 +- crypto/tss/ecdsa/cggmp/sign/message.pb.go | 2 +- crypto/tss/ecdsa/cggmp/signSix/message.pb.go | 2 +- crypto/tss/ecdsa/gg18/addshare/message.pb.go | 2 +- crypto/tss/ecdsa/gg18/reshare/message.pb.go | 2 +- crypto/tss/ecdsa/gg18/signer/message.pb.go | 2 +- crypto/tss/eddsa/frost/signer/message.pb.go | 2 +- crypto/utils/message.pb.go | 12 +- crypto/zkproof/message.pb.go | 2 +- crypto/zkproof/paillier/message.pb.go | 2 +- 29 files changed, 129 insertions(+), 102 deletions(-) diff --git a/crypto/binaryfield/message.pb.go b/crypto/binaryfield/message.pb.go index 5aba9469..cd49de6a 100644 --- a/crypto/binaryfield/message.pb.go +++ b/crypto/binaryfield/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/binaryfield/message.proto package binaryfield diff --git a/crypto/binaryquadraticform/message.pb.go b/crypto/binaryquadraticform/message.pb.go index 862d809b..a5630f07 100644 --- a/crypto/binaryquadraticform/message.pb.go +++ b/crypto/binaryquadraticform/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/binaryquadraticform/message.proto package binaryquadraticform diff --git a/crypto/bip32/child/message.pb.go b/crypto/bip32/child/message.pb.go index 95826d85..c3aaab6f 100644 --- a/crypto/bip32/child/message.pb.go +++ b/crypto/bip32/child/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/bip32/child/message.proto package child diff --git a/crypto/bip32/master/0_initial_handler.go b/crypto/bip32/master/0_initial_handler.go index d44af5ce..0e802c9a 100644 --- a/crypto/bip32/master/0_initial_handler.go +++ b/crypto/bip32/master/0_initial_handler.go @@ -33,6 +33,7 @@ import ( const ( SeedLength = 32 Threshold = 2 + LenRidi = 32 otherInfoBitStr = "0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000010000000000010001000000000001000001010001010000000000000100010100000101000000010001010101000100000100000100010101010101010100010101000101010000000000000001000100000001000001000101010100010001000101000001010100000101010001010001010100010001000100010101000100010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000001010100010100010100000100010100010100010001000100000100000000000001000001010100000101000001010101010101010100010000000000010000010000010000000101000101010100010100000101000000010101010001000100010001000101000101010000000101010101000101010101010001010101000100000101000101000101000001000001000101010100010100000001000100000001010001000000000101010001000001000100000001000100000000000100010001000100000101000101000100000101010000000100010100000101010001010101000001010000000101000001010101000101010101010101000001000100010000010000000000010001010001000001010101010100000100000000000100010100010100000000010000010000010100000101010001000101010000010100000100000101000000000100010100000001010101000101010101010001000001010101000001000101000000010001010100010100010001010100000101000000000100000000010000000100000101010001010000000100010100000000010101000100000100010000010000000101010100010100000101010000000001010000000000010100000000000101000000000001000001010001000000010001010101000100010001000000010101000100000101010001010000010100000100010100010000010100010001010000000101010101000000000001010000000000000101010001000101000101000101010100000100010000010001010001010001000001010001010101000100000000010100000101010100000001000001000000000000000000000100010000000000010101010000000101010100010100000000000100000001010101010000000001010000000001010001010000010100010001000001000101000001000101000000010101010101010000010100000100000001010101000001010001010101000101000001000100010001000000010101010100000000010100000001000100000101000001000101000001010001000100000101000000000000010100000001010000010100000101010100010100010000000000000100000100010000000001000001000000000100000101000100010101010001000000000100000100000001000101000100010101010000010001010100010101010101010001010100000000000101010101000101000000000000000001000001010101010100000101010100010001000100000001010101000100000000010001010100010101000101010100010100010101000001000101010001000001000000000100000000010100010001010100010101010000010000010001010101000101010001" ) @@ -46,6 +47,7 @@ type initial struct { peers map[string]*peer selfId string + ridi []byte bk *birkhoffinterpolation.BkParameter bks birkhoffinterpolation.BkParameters sid []byte @@ -108,6 +110,11 @@ func newMasterKeyFunc(startIndex int, garbleStart int, garbleEnd int, computeFun return nil, ErrInvalidSeed } + ridi, err := utils.GenRandomBytes(LenRidi) + if err != nil { + return nil, err + } + // Random x and build bk x, err := utils.RandomPositiveInt(secp256k1N) if err != nil { @@ -140,6 +147,7 @@ func newMasterKeyFunc(startIndex int, garbleStart int, garbleEnd int, computeFun peers: peers, selfId: peerManager.SelfID(), + ridi: ridi, bk: bk, sid: sid, garcircuit: garcir, @@ -157,6 +165,7 @@ func newMasterKeyFunc(startIndex int, garbleStart int, garbleEnd int, computeFun GarcirMsg: garMsg, OtherInfoWire: garcir.Encrypt(1024, otherInfoBit), Bk: bk.ToMessage(), + Ridi: ridi, }, }, }, @@ -204,6 +213,8 @@ func (s *initial) HandleMessage(logger log.Logger, message types.Message) error s.bk, bk, } + // Set for CGGMP + peer.ridi = body.GetRidi() err = s.bks.CheckValid(Threshold, secp256k1N) if err != nil { logger.Warn("Invalid bks", "err", err) diff --git a/crypto/bip32/master/5_result_handler.go b/crypto/bip32/master/5_result_handler.go index 27b7739f..b05cebfb 100644 --- a/crypto/bip32/master/5_result_handler.go +++ b/crypto/bip32/master/5_result_handler.go @@ -18,6 +18,7 @@ import ( "math/big" pt "github.com/getamis/alice/crypto/ecpointgrouplaw" + "github.com/getamis/alice/crypto/utils" "github.com/getamis/alice/crypto/zkproof" "github.com/getamis/alice/types" "github.com/getamis/sirius/log" @@ -28,6 +29,7 @@ type resultHandler struct { share *big.Int shareG *pt.ECPoint + rid []byte } func newResultHandler(oh *decommitmentHandler) *resultHandler { @@ -76,10 +78,11 @@ func (s *resultHandler) HandleMessage(logger log.Logger, message types.Message) logger.Warn("Failed to verify", "err", err) return err } + s.rid = utils.Xor(s.ridi, peer.ridi) s.share = new(big.Int).Add(s.poly.Evaluate(s.bk.GetX()), new(big.Int).SetBytes(body.GetResult().Evaluation)) s.share = s.share.Mul(s.share, big2Inver) s.share = s.share.Mod(s.share, secp256k1N) - shareGMsg, err := zkproof.NewBaseSchorrMessage(curve, s.share) + shareGMsg, err := zkproof.NewBaseSchorrMessage(curve, s.share, s.rid) if err != nil { logger.Warn("Failed to get share G message", "err", err) return err diff --git a/crypto/bip32/master/6_verify_handler.go b/crypto/bip32/master/6_verify_handler.go index 69af16d6..d4c27014 100644 --- a/crypto/bip32/master/6_verify_handler.go +++ b/crypto/bip32/master/6_verify_handler.go @@ -57,7 +57,7 @@ func (s *verifyHandler) HandleMessage(logger log.Logger, message types.Message) } shareGMsg := msg.GetVerify().GetShareGProofMsg() - err := shareGMsg.Verify(ecpointgrouplaw.NewBase(curve)) + err := shareGMsg.Verify(ecpointgrouplaw.NewBase(curve), s.rid) if err != nil { logger.Warn("Failed to verify Schorr proof", "err", err) return err diff --git a/crypto/bip32/master/master.go b/crypto/bip32/master/master.go index 6f96d7f0..b681f7ad 100644 --- a/crypto/bip32/master/master.go +++ b/crypto/bip32/master/master.go @@ -46,6 +46,7 @@ type Result struct { Bks map[string]*birkhoffinterpolation.BkParameter Seed []byte ChainCode []byte + Rid []byte } type Master struct { @@ -135,5 +136,6 @@ func (m *Master) GetResult() (*Result, error) { Bks: bks, ChainCode: rh.chiancode, Seed: rh.seed, + Rid: rh.rid, }, nil } diff --git a/crypto/bip32/master/message.pb.go b/crypto/bip32/master/message.pb.go index 25147cf0..be8b4642 100644 --- a/crypto/bip32/master/message.pb.go +++ b/crypto/bip32/master/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/bip32/master/message.proto package master @@ -276,6 +276,7 @@ type BodyInitial struct { GarcirMsg *circuit.GarbleCircuitMessage `protobuf:"bytes,2,opt,name=garcirMsg,proto3" json:"garcirMsg,omitempty"` OtherInfoWire [][]byte `protobuf:"bytes,3,rep,name=otherInfoWire,proto3" json:"otherInfoWire,omitempty"` Bk *birkhoffinterpolation.BkParameterMessage `protobuf:"bytes,4,opt,name=bk,proto3" json:"bk,omitempty"` + Ridi []byte `protobuf:"bytes,5,opt,name=ridi,proto3" json:"ridi,omitempty"` } func (x *BodyInitial) Reset() { @@ -338,6 +339,13 @@ func (x *BodyInitial) GetBk() *birkhoffinterpolation.BkParameterMessage { return nil } +func (x *BodyInitial) GetRidi() []byte { + if x != nil { + return x.Ridi + } + return nil +} + type BodyOtReceiver struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -716,7 +724,7 @@ var file_github_com_getamis_alice_crypto_bip32_master_message_proto_rawDesc = [] 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x62, 0x69, 0x70, 0x33, 0x32, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x00, 0x52, 0x06, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x9d, 0x02, 0x0a, 0x0b, + 0x69, 0x66, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xb1, 0x02, 0x0a, 0x0b, 0x42, 0x6f, 0x64, 0x79, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x46, 0x0a, 0x08, 0x6f, 0x74, 0x52, 0x65, 0x63, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, @@ -734,80 +742,81 @@ var file_github_com_getamis_alice_crypto_bip32_master_message_proto_rawDesc = [] 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x62, 0x69, 0x72, 0x6b, 0x68, 0x6f, 0x66, 0x66, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x02, 0x62, 0x6b, 0x22, 0x68, 0x0a, 0x0e, 0x42, - 0x6f, 0x64, 0x79, 0x4f, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x56, 0x0a, - 0x0f, 0x6f, 0x74, 0x45, 0x78, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x73, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, - 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6f, 0x74, - 0x2e, 0x4f, 0x74, 0x45, 0x78, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x0f, 0x6f, 0x74, 0x45, 0x78, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x4d, 0x73, 0x67, 0x22, 0x7b, 0x0a, 0x12, 0x42, 0x6f, 0x64, 0x79, 0x4f, 0x74, 0x53, - 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x14, 0x6f, - 0x74, 0x45, 0x78, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x65, 0x74, 0x61, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x02, 0x62, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x72, + 0x69, 0x64, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x69, 0x64, 0x69, 0x22, + 0x68, 0x0a, 0x0e, 0x42, 0x6f, 0x64, 0x79, 0x4f, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x72, 0x12, 0x56, 0x0a, 0x0f, 0x6f, 0x74, 0x45, 0x78, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x65, 0x74, + 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2e, 0x6f, 0x74, 0x2e, 0x4f, 0x74, 0x45, 0x78, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0f, 0x6f, 0x74, 0x45, 0x78, 0x74, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x73, 0x67, 0x22, 0x7b, 0x0a, 0x12, 0x42, 0x6f, 0x64, + 0x79, 0x4f, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x65, 0x0a, 0x14, 0x6f, 0x74, 0x45, 0x78, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6f, 0x74, 0x2e, 0x4f, 0x74, 0x45, 0x78, 0x74, 0x53, 0x65, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x14, 0x6f, 0x74, 0x45, 0x78, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x22, 0xec, 0x01, 0x0a, 0x0e, 0x42, 0x6f, 0x64, 0x79, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6e, 0x0a, 0x16, 0x72, 0x61, 0x6e, + 0x64, 0x6f, 0x6d, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x2e, 0x6f, 0x74, 0x2e, 0x4f, 0x74, 0x45, 0x78, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x14, 0x6f, 0x74, - 0x45, 0x78, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, - 0x73, 0x67, 0x22, 0xec, 0x01, 0x0a, 0x0e, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6e, 0x0a, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x43, - 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, - 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x16, 0x72, - 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6a, 0x0a, 0x14, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, - 0x65, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, - 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x14, 0x72, 0x61, 0x6e, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, 0x68, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6a, 0x0a, 0x14, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x22, 0xbe, 0x02, 0x0a, 0x10, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x72, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, - 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x44, 0x65, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x44, 0x65, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x52, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x44, - 0x65, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x70, 0x0a, 0x16, 0x72, 0x61, - 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x65, 0x65, 0x64, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x65, 0x74, - 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, - 0x68, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x65, 0x65, 0x64, - 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x02, - 0x61, 0x47, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, - 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, - 0x65, 0x63, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x6c, 0x61, 0x77, 0x2e, - 0x45, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x02, - 0x61, 0x47, 0x22, 0x5b, 0x0a, 0x0a, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x4d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x35, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, - 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x2e, 0x46, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x6e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0x67, 0x0a, 0x0a, 0x42, 0x6f, 0x64, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x59, 0x0a, - 0x0e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x47, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4d, 0x73, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, - 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x7a, 0x6b, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x47, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4d, 0x73, 0x67, 0x2a, 0x71, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0e, 0x0a, - 0x0a, 0x4f, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, - 0x0e, 0x4f, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x10, - 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x10, - 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x05, 0x12, - 0x0a, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x10, 0x06, 0x42, 0x2e, 0x5a, 0x2c, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, - 0x73, 0x2f, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x62, - 0x69, 0x70, 0x33, 0x32, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x14, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xbe, 0x02, 0x0a, 0x10, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x72, 0x0a, 0x17, 0x72, 0x61, + 0x6e, 0x64, 0x6f, 0x6d, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x44, 0x65, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x65, + 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x61, + 0x73, 0x68, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x43, 0x68, 0x6f, + 0x6f, 0x73, 0x65, 0x44, 0x65, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x70, + 0x0a, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x65, 0x65, 0x64, 0x44, 0x65, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, + 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x48, 0x61, 0x73, 0x68, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, + 0x53, 0x65, 0x65, 0x64, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x44, 0x0a, 0x02, 0x61, 0x47, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, + 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x2e, 0x65, 0x63, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x6c, 0x61, 0x77, 0x2e, 0x45, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x02, 0x61, 0x47, 0x22, 0x5b, 0x0a, 0x0a, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x65, 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2e, 0x61, + 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x6e, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x67, 0x0a, 0x0a, 0x42, 0x6f, 0x64, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x12, 0x59, 0x0a, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x47, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x65, 0x74, 0x61, + 0x6d, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x2e, 0x7a, 0x6b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x47, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4d, 0x73, 0x67, 0x2a, 0x71, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x10, + 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x10, + 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x10, 0x06, 0x42, + 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, + 0x74, 0x61, 0x6d, 0x69, 0x73, 0x2f, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2f, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x2f, 0x62, 0x69, 0x70, 0x33, 0x32, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/crypto/bip32/master/message.proto b/crypto/bip32/master/message.proto index ffe13c50..6d763765 100644 --- a/crypto/bip32/master/message.proto +++ b/crypto/bip32/master/message.proto @@ -54,6 +54,7 @@ message BodyInitial { circuit.garbleCircuitMessage garcirMsg = 2; repeated bytes otherInfoWire =3; birkhoffinterpolation.BkParameterMessage bk = 4; + bytes ridi = 5; } message BodyOtReceiver { diff --git a/crypto/bip32/master/peer.go b/crypto/bip32/master/peer.go index 92765fdd..7ec4d369 100644 --- a/crypto/bip32/master/peer.go +++ b/crypto/bip32/master/peer.go @@ -28,6 +28,7 @@ type peer struct { aG *pt.ECPoint randomChooseG *pt.ECPoint randomSeedG *pt.ECPoint + ridi []byte } func newPeer(id string) *peer { diff --git a/crypto/birkhoffinterpolation/bk.pb.go b/crypto/birkhoffinterpolation/bk.pb.go index 2e40af39..e4dae361 100644 --- a/crypto/birkhoffinterpolation/bk.pb.go +++ b/crypto/birkhoffinterpolation/bk.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/birkhoffinterpolation/bk.proto package birkhoffinterpolation diff --git a/crypto/circuit/message.pb.go b/crypto/circuit/message.pb.go index f7c6a523..b654dd61 100644 --- a/crypto/circuit/message.pb.go +++ b/crypto/circuit/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/circuit/message.proto package circuit diff --git a/crypto/commitment/message.pb.go b/crypto/commitment/message.pb.go index 604613c1..a621fc49 100644 --- a/crypto/commitment/message.pb.go +++ b/crypto/commitment/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/commitment/message.proto package commitment diff --git a/crypto/ecpointgrouplaw/point.pb.go b/crypto/ecpointgrouplaw/point.pb.go index 438fc9ad..2ac98343 100644 --- a/crypto/ecpointgrouplaw/point.pb.go +++ b/crypto/ecpointgrouplaw/point.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/ecpointgrouplaw/point.proto package ecpointgrouplaw diff --git a/crypto/homo/cl/message.pb.go b/crypto/homo/cl/message.pb.go index 75f56ae8..01175081 100644 --- a/crypto/homo/cl/message.pb.go +++ b/crypto/homo/cl/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/homo/cl/message.proto package cl diff --git a/crypto/homo/paillier/message.pb.go b/crypto/homo/paillier/message.pb.go index d42ec304..6ddd0b6c 100644 --- a/crypto/homo/paillier/message.pb.go +++ b/crypto/homo/paillier/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/homo/paillier/message.proto package paillier diff --git a/crypto/ot/message.pb.go b/crypto/ot/message.pb.go index 34b9f695..ac359744 100644 --- a/crypto/ot/message.pb.go +++ b/crypto/ot/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/ot/message.proto package ot diff --git a/crypto/tss/dkg/message.pb.go b/crypto/tss/dkg/message.pb.go index 40080d54..b6bfce5d 100644 --- a/crypto/tss/dkg/message.pb.go +++ b/crypto/tss/dkg/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/dkg/message.proto package dkg diff --git a/crypto/tss/ecdsa/cggmp/dkg/message.pb.go b/crypto/tss/ecdsa/cggmp/dkg/message.pb.go index ea21692e..430a1e32 100644 --- a/crypto/tss/ecdsa/cggmp/dkg/message.pb.go +++ b/crypto/tss/ecdsa/cggmp/dkg/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/cggmp/dkg/message.proto package dkg diff --git a/crypto/tss/ecdsa/cggmp/refresh/message.pb.go b/crypto/tss/ecdsa/cggmp/refresh/message.pb.go index 7397db2b..4cdac023 100644 --- a/crypto/tss/ecdsa/cggmp/refresh/message.pb.go +++ b/crypto/tss/ecdsa/cggmp/refresh/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/cggmp/refresh/message.proto package refresh diff --git a/crypto/tss/ecdsa/cggmp/sign/message.pb.go b/crypto/tss/ecdsa/cggmp/sign/message.pb.go index bb2a2daa..ad26cf54 100644 --- a/crypto/tss/ecdsa/cggmp/sign/message.pb.go +++ b/crypto/tss/ecdsa/cggmp/sign/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/cggmp/sign/message.proto package sign diff --git a/crypto/tss/ecdsa/cggmp/signSix/message.pb.go b/crypto/tss/ecdsa/cggmp/signSix/message.pb.go index 898f7091..8f77802d 100644 --- a/crypto/tss/ecdsa/cggmp/signSix/message.pb.go +++ b/crypto/tss/ecdsa/cggmp/signSix/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/cggmp/signSix/message.proto package signSix diff --git a/crypto/tss/ecdsa/gg18/addshare/message.pb.go b/crypto/tss/ecdsa/gg18/addshare/message.pb.go index 9743247b..43935837 100644 --- a/crypto/tss/ecdsa/gg18/addshare/message.pb.go +++ b/crypto/tss/ecdsa/gg18/addshare/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/gg18/addshare/message.proto package addshare diff --git a/crypto/tss/ecdsa/gg18/reshare/message.pb.go b/crypto/tss/ecdsa/gg18/reshare/message.pb.go index 098460c2..f50aab89 100644 --- a/crypto/tss/ecdsa/gg18/reshare/message.pb.go +++ b/crypto/tss/ecdsa/gg18/reshare/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/gg18/reshare/message.proto package reshare diff --git a/crypto/tss/ecdsa/gg18/signer/message.pb.go b/crypto/tss/ecdsa/gg18/signer/message.pb.go index 80c7b347..f1eef30f 100644 --- a/crypto/tss/ecdsa/gg18/signer/message.pb.go +++ b/crypto/tss/ecdsa/gg18/signer/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/ecdsa/gg18/signer/message.proto package signer diff --git a/crypto/tss/eddsa/frost/signer/message.pb.go b/crypto/tss/eddsa/frost/signer/message.pb.go index f4a91677..50e75d1c 100644 --- a/crypto/tss/eddsa/frost/signer/message.pb.go +++ b/crypto/tss/eddsa/frost/signer/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/tss/eddsa/frost/signer/message.proto package signer diff --git a/crypto/utils/message.pb.go b/crypto/utils/message.pb.go index 3077b5b0..6c3405da 100644 --- a/crypto/utils/message.pb.go +++ b/crypto/utils/message.pb.go @@ -15,15 +15,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/utils/message.proto package utils import ( - any "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" ) @@ -40,7 +40,7 @@ type Hash struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Msgs []*any.Any `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs,omitempty"` + Msgs []*anypb.Any `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs,omitempty"` } func (x *Hash) Reset() { @@ -75,7 +75,7 @@ func (*Hash) Descriptor() ([]byte, []int) { return file_github_com_getamis_alice_crypto_utils_message_proto_rawDescGZIP(), []int{0} } -func (x *Hash) GetMsgs() []*any.Any { +func (x *Hash) GetMsgs() []*anypb.Any { if x != nil { return x.Msgs } @@ -114,8 +114,8 @@ func file_github_com_getamis_alice_crypto_utils_message_proto_rawDescGZIP() []by var file_github_com_getamis_alice_crypto_utils_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_github_com_getamis_alice_crypto_utils_message_proto_goTypes = []interface{}{ - (*Hash)(nil), // 0: getamis.alice.crypto.utils.Hash - (*any.Any)(nil), // 1: google.protobuf.Any + (*Hash)(nil), // 0: getamis.alice.crypto.utils.Hash + (*anypb.Any)(nil), // 1: google.protobuf.Any } var file_github_com_getamis_alice_crypto_utils_message_proto_depIdxs = []int32{ 1, // 0: getamis.alice.crypto.utils.Hash.msgs:type_name -> google.protobuf.Any diff --git a/crypto/zkproof/message.pb.go b/crypto/zkproof/message.pb.go index d7cfece0..5e038bbb 100644 --- a/crypto/zkproof/message.pb.go +++ b/crypto/zkproof/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/zkproof/message.proto package zkproof diff --git a/crypto/zkproof/paillier/message.pb.go b/crypto/zkproof/paillier/message.pb.go index 130b9d29..edc3b5b2 100644 --- a/crypto/zkproof/paillier/message.pb.go +++ b/crypto/zkproof/paillier/message.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.12 // source: github.com/getamis/alice/crypto/zkproof/paillier/message.proto package paillier From baf0b344c2a91f3e0c5d241d36eaa0cc71d93e30 Mon Sep 17 00:00:00 2001 From: ChihYunChuang Date: Sat, 25 Mar 2023 09:31:15 +0800 Subject: [PATCH 2/2] crypto/bip32: add partialPubKey in Child Key Generation --- crypto/bip32/child/share_manager.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crypto/bip32/child/share_manager.go b/crypto/bip32/child/share_manager.go index 7b082c03..1f0995ea 100644 --- a/crypto/bip32/child/share_manager.go +++ b/crypto/bip32/child/share_manager.go @@ -69,7 +69,8 @@ type shareManager struct { type childShare struct { *shareManager - translate *big.Int + translate *big.Int + otherPartialShareG *ecpointgrouplaw.ECPoint } func NewShareManager(share *big.Int, pubKey *ecpointgrouplaw.ECPoint, chainCode []byte, depth byte, bks map[string]*birkhoffinterpolation.BkParameter, selfId string) (*shareManager, error) { @@ -143,11 +144,19 @@ func (sHolder *shareManager) ComputeHardenedChildShare(childIndex uint32, second } cs := new(big.Int).Add(sHolder.share, halfTranslate) + // set otherPartial PubKey + otherPartialKey, err := childPubKey.Add(ecpointgrouplaw.ScalarBaseMult(childPubKey.GetCurve(), cs).Neg()) + if err != nil { + return nil, err + } + otherPartialKey = otherPartialKey.ScalarMult(new(big.Int).ModInverse(cos[1], curveN)) + // Set bk coefficients cs = new(big.Int).Mul(cs, new(big.Int).ModInverse(cos[0], curveN)) cs = cs.Mod(cs, curveN) return &childShare{ - translate: translate, + translate: translate, + otherPartialShareG: otherPartialKey, shareManager: &shareManager{ share: cs, chainCode: hashResult[32:],