Commit d8dcab83 authored by mdj33's avatar mdj33 Committed by vipwzw

rename wallet.proto

parent af17a90f
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.23.0
// protoc v3.9.1
// source: cryptokey.proto
package types
import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
......@@ -21,6 +21,10 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
//DH one time pubkey with secret
type DHSecret struct {
state protoimpl.MessageState
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.23.0
// protoc v3.9.1
// source: merkletree.proto
package types
import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
......@@ -21,6 +21,10 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
//子树用高度和hash描述,2^10=1024个叶子节点,子树高度不会超过10
type CommitSubTree struct {
state protoimpl.MessageState
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.23.0
// protoc v3.9.1
// source: mix.proto
package types
import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
......@@ -21,6 +21,10 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
//区分不同的验证电路
type VerifyType int32
......
......@@ -20,7 +20,7 @@ func TestNewPrivacyWithPrivKey(t *testing.T) {
pairs := newPrivacyKey(keyByte)
t.Log("payPri", pairs.PaymentKey.SpendKey, "payPub", pairs.PaymentKey.ReceiveKey)
t.Log("crytoPub", pairs.EncryptKey.PubKey, "crytoPri", pairs.EncryptKey.PrivKey)
t.Log("crytoPub", pairs.SecretKey.SecretPubKey, "crytoPri", pairs.SecretKey.SecretPrivKey)
//prikey2 := "1257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
//keyByte2, err := hex.DecodeString(prikey2)
......@@ -37,11 +37,11 @@ func TestNewPrivacyWithPrivKey(t *testing.T) {
Amount: "28242048",
}
data, err := encryptData(pairs.EncryptKey.PubKey, types.Encode(secret1))
data, err := encryptData(pairs.SecretKey.SecretPubKey, types.Encode(secret1))
assert.Nil(t, err)
crypData, err := common.FromHex(data.Secret)
assert.Nil(t, err)
decryData1, err := decryptData(pairs.EncryptKey.PrivKey, data.OneTimePubKey, crypData)
decryData1, err := decryptData(pairs.SecretKey.SecretPrivKey, data.OneTimePubKey, crypData)
assert.Nil(t, err)
var val mixTy.SecretData
err = types.Decode(decryData1, &val)
......@@ -94,14 +94,14 @@ func TestEncodeSecretData(t *testing.T) {
hexRet := hex.EncodeToString(ret)
//assert.Nil(t,err)
req := &mixTy.EncryptSecretData{PeerKey: privacy.EncryptKey.PubKey, Secret: hexRet}
req := &mixTy.EncryptSecretData{PeerSecretPubKey: privacy.SecretKey.SecretPubKey, Secret: hexRet}
dhSecret, err := encryptSecretData(req)
assert.Nil(t, err)
//t.Log(dhSecret)
data, err := common.FromHex(dhSecret.Secret)
assert.Nil(t, err)
rawData, err := decryptData(privacy.EncryptKey.PrivKey, dhSecret.OneTimePubKey, data)
rawData, err := decryptData(privacy.SecretKey.SecretPrivKey, dhSecret.OneTimePubKey, data)
assert.Nil(t, err)
var rawSecret mixTy.SecretData
types.Decode(rawData, &rawSecret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment