Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
1578dafa
Commit
1578dafa
authored
Oct 26, 2020
by
pengjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'paillier'
parents
ea08eae7
4b93825f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
340 additions
and
91 deletions
+340
-91
paillier.go
plugin/crypto/paillier/paillier.go
+88
-0
paillier_test.go
plugin/crypto/paillier/paillier_test.go
+18
-0
exec.go
plugin/dapp/storage/executor/exec.go
+6
-0
exec_local.go
plugin/dapp/storage/executor/exec_local.go
+21
-0
storage_test.go
plugin/dapp/storage/executor/storage_test.go
+22
-0
storagedb.go
plugin/dapp/storage/executor/storagedb.go
+44
-0
storage.proto
plugin/dapp/storage/proto/storage.proto
+12
-2
types.go
plugin/dapp/storage/rpc/types.go
+1
-2
storage.go
plugin/dapp/storage/types/storage.go
+5
-0
storage.pb.go
plugin/dapp/storage/types/storage.pb.go
+123
-87
No files found.
plugin/crypto/paillier/paillier.go
0 → 100644
View file @
1578dafa
package
paillier
import
(
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/types"
"math/big"
)
func
CiphertextAdd
(
ciphertext1
,
ciphertext2
string
)
(
string
,
error
)
{
cipherbytes1
,
err
:=
common
.
FromHex
(
ciphertext1
)
if
err
!=
nil
{
fmt
.
Errorf
(
"CiphertextAdd.FromHex. ciphertext1:%s, error:%v"
,
ciphertext1
,
err
)
return
""
,
err
}
cipherbytes2
,
err
:=
common
.
FromHex
(
ciphertext2
)
if
err
!=
nil
{
fmt
.
Errorf
(
"CiphertextAdd.FromHex. ciphertext2:%s, error:%v"
,
ciphertext2
,
err
)
return
""
,
err
}
res
,
err
:=
CiphertextAddBytes
(
cipherbytes1
,
cipherbytes2
)
if
err
!=
nil
{
fmt
.
Errorf
(
"CiphertextAdd.CiphertextAddBytes. error:%v"
,
err
)
return
""
,
nil
}
return
hex
.
EncodeToString
(
res
),
nil
}
func
CiphertextAddBytes
(
cipherbytes1
,
cipherbytes2
[]
byte
)
([]
byte
,
error
)
{
nlen1
:=
bytesToInt
(
cipherbytes1
[
0
:
2
])
if
nlen1
>=
len
(
cipherbytes1
)
-
2
{
fmt
.
Errorf
(
"CiphertextAddBytes. error param length"
)
return
nil
,
types
.
ErrInvalidParam
}
nBytes1
:=
make
([]
byte
,
nlen1
)
copy
(
nBytes1
,
cipherbytes1
[
2
:
2
+
nlen1
])
nlen2
:=
bytesToInt
(
cipherbytes2
[
0
:
2
])
if
nlen2
>=
len
(
cipherbytes2
)
-
2
{
fmt
.
Errorf
(
"CiphertextAddBytes. error param length"
)
return
nil
,
types
.
ErrInvalidParam
}
nBytes2
:=
make
([]
byte
,
nlen2
)
copy
(
nBytes2
,
cipherbytes2
[
2
:
2
+
nlen2
])
if
!
bytes
.
Equal
(
nBytes1
,
nBytes2
)
{
fmt
.
Errorf
(
"CiphertextAddBytes. error: param error n1!=n2"
)
return
nil
,
types
.
ErrInvalidParam
}
data1
:=
make
([]
byte
,
len
(
cipherbytes1
)
-
nlen1
-
2
)
copy
(
data1
,
cipherbytes1
[
2
+
nlen1
:
])
data2
:=
make
([]
byte
,
len
(
cipherbytes2
)
-
nlen2
-
2
)
copy
(
data2
,
cipherbytes2
[
2
+
nlen2
:
])
cipher1
:=
new
(
big
.
Int
)
.
SetBytes
(
data1
)
cipher2
:=
new
(
big
.
Int
)
.
SetBytes
(
data2
)
n1
:=
new
(
big
.
Int
)
.
SetBytes
(
nBytes1
)
nsquare
:=
new
(
big
.
Int
)
.
Mul
(
n1
,
n1
)
res
:=
big
.
NewInt
(
0
)
res
.
Mul
(
cipher1
,
cipher2
)
.
Mod
(
res
,
nsquare
)
data
:=
make
([]
byte
,
nlen1
+
2
+
len
(
res
.
Bytes
()))
copy
(
data
[
:
nlen1
+
2
],
cipherbytes1
[
:
nlen1
+
2
])
copy
(
data
[
nlen1
+
2
:
],
res
.
Bytes
())
return
data
,
nil
}
func
bytesToInt
(
cipherbytes
[]
byte
)
int
{
bytebuff
:=
bytes
.
NewBuffer
(
cipherbytes
)
var
data
int16
binary
.
Read
(
bytebuff
,
binary
.
BigEndian
,
&
data
)
return
int
(
data
)
}
\ No newline at end of file
plugin/crypto/paillier/paillier_test.go
0 → 100644
View file @
1578dafa
package
paillier
import
(
"github.com/stretchr/testify/assert"
"testing"
)
func
TestCiphertextAdd
(
t
*
testing
.
T
)
{
c1
:=
"010070061bde0fc57d38e0ce9c82c088f793a93a20f830ed94a5f7e01f5af0decccf0ee7f70a711dc78b69b40f7e411f7f6ff34a5de4ad32fa5dc9d09b09dbbcf8e49bb1c9be19b215577167458b969bb40634f71dba00bdfdd12f1c878effd9e08475b8301a214bc7dfc95c2f341aa8fbd985a5da05af046336c23cf356570772530017c9a8bb96140977698d50c3258e8d31c040bb887c56d3d6e583db7a4ff2ea28aa93885312dfa50bf86a15618288b2c2701e6d75743fec9f3ca35b7e20ad902ad6985fe0b3c389b9582b3c62d9bea90230d1512a07c66a5404bf804693b6bb677a4ff038ae4a762f89f6a877d7621f7461431a7d4cadaf1687057ca4a9d1570e4ceeab32c86856d89731d50edf6f0886ccf348cc4565227f1df6b813569c49b3170e9efd722e4f4e957add9a115a2122a9f5c00780a1b8020d44b8b865d16113eadcfd15d1b755aed7c983b3d4b9390eda68d22d165a32d4055eee95adee79d7d28d2ee6d593d4eff217cd3e3d70bb9c32a6608af78afb7d5cb7ee0422500273b934209b950cd07842ab7e10c0dfc790d212c9085058d39c667b7dfff0963478118451ec64af30aff518384cc47758b2aa4331c8b5f36d6d1b9c3a6ee7ba77d28ea6ca844960e24ab6384e36127745f1285f3b71cea6c5c6a41c51ca7edbfae07766a3fb7bd9ef6b8f999460741a5b44eeb0b98937b57f4582294e18fd70d402dee2e557fa7df5cfb13240458f77b62a32169940ab5a1fce95b52583ecb13e21c22749f7620caaa6fd998e4f9bd0e617c925b83bed5ed2215ec8a404357a782b70d2c6ece6fa7a4fb30d18a01b81b2f3a8e38cc12f32becfdf195e02879b710f2feda5b0c2e86ba6df2a0fa25c60cef58224ee466787034cc5d0872a28cf8d6bad106125660b0b4bfe86eacb829dbb073420ff3af3ac76e5718c199fcf53258397a9e4fed0d98f360d16248693aced1ecbc5ca5211f48df011d14d372ee07f9b7c24bc219f3cdc403ebeb5b452643ddd1f4276779fab76a19c8b195a1213a235f7facf67a26b8a7804cb326f58200d756d62d40edb650498c198a524c091f0"
c2
:=
"010070061bde0fc57d38e0ce9c82c088f793a93a20f830ed94a5f7e01f5af0decccf0ee7f70a711dc78b69b40f7e411f7f6ff34a5de4ad32fa5dc9d09b09dbbcf8e49bb1c9be19b215577167458b969bb40634f71dba00bdfdd12f1c878effd9e08475b8301a214bc7dfc95c2f341aa8fbd985a5da05af046336c23cf356570772530017c9a8bb96140977698d50c3258e8d31c040bb887c56d3d6e583db7a4ff2ea28aa93885312dfa50bf86a15618288b2c2701e6d75743fec9f3ca35b7e20ad902ad6985fe0b3c389b9582b3c62d9bea90230d1512a07c66a5404bf804693b6bb677a4ff038ae4a762f89f6a877d7621f7461431a7d4cadaf1687057ca4a9d157195acafe73f5eed77b314dd640999ee20de461600ce3d3620cef84abc256774a514db5b65721cd93d1601e0fa8f53630dbe8567493018588e9619783e1526eb9bc56cc7b37c99025a9bdc10465bfb01605232292e50ac3b56b2ffefe48f0615651649d1db4ebff57d955e434f0c564b2a6842d3af04be1bfc5e968abe390f15bc89b9a4ed7a00b82beea07cf8e03c82bdd6a40b6c6334e51a432024caf9247db25058eb0cbce567ed49c56730058480e5854f3888e988053c403045239098ba6977aa0adb7f6dec785d31bacee8276a87d7a8f2114bb6662a117e3e37846c5b713e599801fbae5185cf21360760721376efe0736b7f4fa049d0c9f3086324be3a0f44d6cae5450d87d79a7bcaa0a2aa259b738ed85a59fead48d985597f6d77022ecdf37685df4182267d4fbdb24747f208a9e1b3126251b320066d8499ab5298395dab0340a78325b39d383d34a31a27f223114a9774498a314e3ba3cf4b87150e1f959f29556e67ae136a6290922e8cd3890c3b93bb68f38990ac3a4700cbe075795f7603755a28f3226e31c29a2eab2bff2423dc6177a6d8eaa950fbe2320b9bee89b8bbc3149b7ee177224e59726f28bcb796ccb09ac6b3feb3256ca033eb177aeea997be798f0e1b63b284dc8361ff870de717263cb86838a0c6cd5a82e12d162bd04f9c85267d4abd3a6828639fd0584a023388cc220d404d4646d0318"
c3
:=
"010070061bde0fc57d38e0ce9c82c088f793a93a20f830ed94a5f7e01f5af0decccf0ee7f70a711dc78b69b40f7e411f7f6ff34a5de4ad32fa5dc9d09b09dbbcf8e49bb1c9be19b215577167458b969bb40634f71dba00bdfdd12f1c878effd9e08475b8301a214bc7dfc95c2f341aa8fbd985a5da05af046336c23cf356570772530017c9a8bb96140977698d50c3258e8d31c040bb887c56d3d6e583db7a4ff2ea28aa93885312dfa50bf86a15618288b2c2701e6d75743fec9f3ca35b7e20ad902ad6985fe0b3c389b9582b3c62d9bea90230d1512a07c66a5404bf804693b6bb677a4ff038ae4a762f89f6a877d7621f7461431a7d4cadaf1687057ca4a9d1571d74c0a358b73242b65cf84139071503ffa45c824d84cb0336510de9a1ad1a7c56142efa23f8b69b4094c940adb42df385fc11bf2704a2608b1a65c5d17f2a051114832ab141290c16201b59eae28639ece329eb5b8003b4f1025e57066115d7d378581268359e0ca94117451ca3aa6b0d597cf8f621b66bf20fc488b18848aa47e31d5939d59b8058def7df416f6734b3821bacd1fc8f4f1d422fc2c17c9bd903e80fabea7eb0f6237f771d0be65941cfca8ed6ec0e412bc940fc09cb0033abe4e668fee7f07a9cba77da04815747271eb32a5a9278ca0f57d7e05cffa6bdb5902984586259fab80be0460e9af3391f2a3212a1e4f350e060f988781e6ab2254e76c972e5611151fa501607d1d342667253d21e9ca113f2b87d823a55e70d4f5899e0ba8121477dded3d3b858438c4d0486a0c9846eb05b737a734ba37cdfdaaca8a4a38f2bd1c1ed0b4583b96c2fd2d1675991b4a151470811b4f4bfbad46ddbaa0e1fa28a81a3801e8c211137db822fb5a07344dc719b13e50562bd1e3a391a7747709db2445543f7412fd9c3011141d9ad4f05182593e6e75033764395fa8be80039cb47ed5d750f62836312e7b23152f69a65e41a9782d841b3c48719403e98bd8e72c824083275a29a53d681dc25b7df6c60cb0c4c74feab1d7b1edc76c09a1fe4da1acf9979d3c200233b082f66710725867ef6418e866cd93d26c7fd"
data
,
err
:=
CiphertextAdd
(
c1
,
c2
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
c3
,
data
)
}
plugin/dapp/storage/executor/exec.go
View file @
1578dafa
...
@@ -35,3 +35,8 @@ func (s *storage) Exec_EncryptShareStorage(payload *storagetypes.EncryptShareNot
...
@@ -35,3 +35,8 @@ func (s *storage) Exec_EncryptShareStorage(payload *storagetypes.EncryptShareNot
action
:=
newStorageAction
(
s
,
tx
,
index
)
action
:=
newStorageAction
(
s
,
tx
,
index
)
return
action
.
EncryptShareStorage
(
payload
)
return
action
.
EncryptShareStorage
(
payload
)
}
}
func
(
s
*
storage
)
Exec_EncryptAdd
(
payload
*
storagetypes
.
EncryptNotaryAdd
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
action
:=
newStorageAction
(
s
,
tx
,
index
)
return
action
.
EncryptAdd
(
payload
)
}
\ No newline at end of file
plugin/dapp/storage/executor/exec_local.go
View file @
1578dafa
...
@@ -115,6 +115,27 @@ func (s *storage) ExecLocal_EncryptShareStorage(payload *ety.EncryptShareNotaryS
...
@@ -115,6 +115,27 @@ func (s *storage) ExecLocal_EncryptShareStorage(payload *ety.EncryptShareNotaryS
return
s
.
addAutoRollBack
(
tx
,
dbSet
.
KV
),
nil
return
s
.
addAutoRollBack
(
tx
,
dbSet
.
KV
),
nil
}
}
func
(
s
*
storage
)
ExecLocal_EncryptAdd
(
payload
*
ety
.
EncryptNotaryAdd
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
dbSet
:=
&
types
.
LocalDBSet
{}
cfg
:=
s
.
GetAPI
()
.
GetConfig
()
if
cfg
.
IsDappFork
(
s
.
GetHeight
(),
ety
.
StorageX
,
ety
.
ForkStorageLocalDB
)
{
if
receiptData
.
Ty
==
types
.
ExecOk
{
for
_
,
log
:=
range
receiptData
.
Logs
{
switch
log
.
Ty
{
case
ety
.
TyEncryptAddLog
:
storage
:=
&
ety
.
Storage
{}
if
err
:=
types
.
Decode
(
log
.
Log
,
storage
);
err
!=
nil
{
return
nil
,
err
}
kv
:=
&
types
.
KeyValue
{
Key
:
getLocalDBKey
(
storage
.
GetEncryptStorage
()
.
Key
),
Value
:
types
.
Encode
(
storage
)}
dbSet
.
KV
=
append
(
dbSet
.
KV
,
kv
)
}
}
}
}
return
s
.
addAutoRollBack
(
tx
,
dbSet
.
KV
),
nil
}
//设置自动回滚
//设置自动回滚
func
(
s
*
storage
)
addAutoRollBack
(
tx
*
types
.
Transaction
,
kv
[]
*
types
.
KeyValue
)
*
types
.
LocalDBSet
{
func
(
s
*
storage
)
addAutoRollBack
(
tx
*
types
.
Transaction
,
kv
[]
*
types
.
KeyValue
)
*
types
.
LocalDBSet
{
...
...
plugin/dapp/storage/executor/storage_test.go
View file @
1578dafa
...
@@ -165,6 +165,28 @@ func TestStorage(t *testing.T) {
...
@@ -165,6 +165,28 @@ func TestStorage(t *testing.T) {
assert
.
Equal
(
t
,
common
.
Sha256
(
contents
[
0
]),
reply
.
GetEncryptStorage
()
.
ContentHash
)
assert
.
Equal
(
t
,
common
.
Sha256
(
contents
[
0
]),
reply
.
GetEncryptStorage
()
.
ContentHash
)
assert
.
Equal
(
t
,
crypted
,
reply
.
GetEncryptStorage
()
.
EncryptContent
)
assert
.
Equal
(
t
,
crypted
,
reply
.
GetEncryptStorage
()
.
EncryptContent
)
assert
.
Equal
(
t
,
ivs
[
0
],
reply
.
GetEncryptStorage
()
.
Nonce
)
assert
.
Equal
(
t
,
ivs
[
0
],
reply
.
GetEncryptStorage
()
.
Nonce
)
// 同态加密
c1
,
_
:=
common
.
FromHex
(
"010076833cbc35c9b7a87eda9aab7aafec45bd7eb8c0e9306141e7d1e84ecd87a5cb9f80343551bd9b0d04669fd74d020fca8837d9b3b471e3e13c125a06663d820cabb36c243747a11ea2601a9cb32e61c697dcdc846c492d954fa8c3ca2be662e8c0142138b647ce5d9e7c4c4d2ace8ba3c5699fbec98beef24e3c740967ec0b72b1626ecd4a7ce54960ae9bc1e2ea5594b05778f4f772aa213a06421744ed8dd775fb8f212bcc7e0da5fe4949051e6aa09d47db7e8d5028ecc41cea2aed4e23aefd80714519662fae980e3a6ca3defc0dd5596cb7e90da29e1bdd84db82603aed78fb8f98687898cd675da74452052ff1761446bf2ee922fc8c56b7e1beb2d4b91042742837052b340e4afce1836badf4a56ef775bb6a94fd91686a44122543fdab3ee90488160068769fbce2e74ffd5e052bb4c651969c4755f6eb5d7ea0cee3e7fa58f4b38b1722535909bd0f325a0b8d0797c15300ab06095b305f46497bbd75c3682d379387f55f638cd10639db1f050090bfd5d291718cee9fc6894d04ba6ef0acb477184512984f435b13e9bffe630bbc8ceade6d269487bf219e25b3beecc46afb98fb8e1fec1a9ad0af0a16e70611f9a4337af05a2ff82d7c9dcebeea9d8e2070413e49e29ff564e6dcee5696e39dc590ff8f8f553834c66c5ae730d05441e3fcc59de0d6efb12fd8852e19f2e309e4ac4cbf0634655fcaab5a70b4eab49829190ea2862c2568e8b69ff0324055f92275de05f2de1d6a8a78333370da754708f7a827f5e9bbe2e58d58294cafef37898a5a5a4866678b6e07941a3bfcb3c3f2d150f830a12d8e0dd20d756099be48f10d51521b3ba0c49f2ab139724ae3962999d75b88bf572fbfd86b6eef3bad5a446b97949d95f9e742500f8609ecfe189d2b4d5a47ea997164f48b3872ec525f16ec23fa5700d10d3385019edfabfec780f15b639f6863332c69fe6b17895620821fe6aaf94caab29c0fec19ff1bebc59f5ed8f973a3b720257cce803541406ae8e75163cf0049f8fbf14d239e86089cdefba8bcbb03db284283a1ff572320aeb7d4a139d4429e00c8bb196539d7"
)
c2
,
_
:=
common
.
FromHex
(
"010076833cbc35c9b7a87eda9aab7aafec45bd7eb8c0e9306141e7d1e84ecd87a5cb9f80343551bd9b0d04669fd74d020fca8837d9b3b471e3e13c125a06663d820cabb36c243747a11ea2601a9cb32e61c697dcdc846c492d954fa8c3ca2be662e8c0142138b647ce5d9e7c4c4d2ace8ba3c5699fbec98beef24e3c740967ec0b72b1626ecd4a7ce54960ae9bc1e2ea5594b05778f4f772aa213a06421744ed8dd775fb8f212bcc7e0da5fe4949051e6aa09d47db7e8d5028ecc41cea2aed4e23aefd80714519662fae980e3a6ca3defc0dd5596cb7e90da29e1bdd84db82603aed78fb8f98687898cd675da74452052ff1761446bf2ee922fc8c56b7e1beb2d4b9338ddba1f37e26ef7e0b9cb3bec18dc4b450d91a1a0901a3aca75000b58dd639635dce66553945a698b186c89443361ab4c1d3525de6bace217cd27fce0c8f6efc9e7c95269139487b5772182d8276ed6edfe0560537d18330aae4191af1dfae0a430b2021401bc17a111730f7114f514b7b84cb09bf717c67bb25c21a31b3a062f32dceb99103cdd622242148ec1799d04f4f3f4fc5af9e18cfaf356388b1413cc95b6f5bc0c293acf09ad0513e15d2ea525f120930e6072e0cf750e4e03bbf65b278ad92476f5e507bb51f01c3d2797931794cad156b5980fb5ec51fc82e99fde99e81dd85e9dba1d549aa8768c609e46171750b7bc636b709e47c92b076f1b7f71bff1fd690f8bfcdbf48559f777017b9ad300cbb3a1089f3eb6fed5632be9edecc33be09da7d43275640a097114f8f9e529289cce15d7b4ba613feda9e4d818743bf2741c5cd2aaaec7cc96ed835ee909ea0e9675f57bad4ad01688cc2a77e6181a0bca9a46d0ca160a1d94771e24db357e861e1f029104782445413c6d4861404df9ec3140b895083ebbb8a92bbc7decc8990353e9347a7933f85ef94ed325a331b3e6e6c752086adc7926abac3dfd8c8f3d7add64c80f327c1c4d74fde7a6c8981f79ede165f0584e5d6317d7272d9836098cd8ef82fbe85770962b709dfe1f2ae3454ac471e6ea24c6545f332a3eb4eecbc09e2276748d484a5216361"
)
c3
,
_
:=
common
.
FromHex
(
"010076833cbc35c9b7a87eda9aab7aafec45bd7eb8c0e9306141e7d1e84ecd87a5cb9f80343551bd9b0d04669fd74d020fca8837d9b3b471e3e13c125a06663d820cabb36c243747a11ea2601a9cb32e61c697dcdc846c492d954fa8c3ca2be662e8c0142138b647ce5d9e7c4c4d2ace8ba3c5699fbec98beef24e3c740967ec0b72b1626ecd4a7ce54960ae9bc1e2ea5594b05778f4f772aa213a06421744ed8dd775fb8f212bcc7e0da5fe4949051e6aa09d47db7e8d5028ecc41cea2aed4e23aefd80714519662fae980e3a6ca3defc0dd5596cb7e90da29e1bdd84db82603aed78fb8f98687898cd675da74452052ff1761446bf2ee922fc8c56b7e1beb2d4b90a734625f41c1709ad56e8a801346d70f190e7080c805de1e380198a4ebaf86ca6e5b9dbdc6eacad7c545f78c718a6e0262bc61d68244f99255d0fc8126cfbc0449e935bf5ee81af5e600f7d5b23b4b2d1f48482e037642690035f0289d4d3c72662d63e958edf8d566c765bcbc44cedc618b31db5eebdc6fd5848d53161e3e01c6c73010c32391db709a71cedb4c45fb71ec85de48ace0cba009ef2c0a88386e62b9607faf36c9b219508281267c0df2a182a88ad8fd146101564f5a14c7fd5ed2d4ae547c8741a31c560501230edd5417c622a7aba8d7efb08c08d5b7c45508c766353f2d43bd092834461f0673196abc8ef56b9fd54bdf82c2a392ff8dedcef3d90d3e47370d31083c2d19cefe2ce83936fd881f4a38ef3e5aaf3b0d48842ded5e6a16fc2fb7b5379406c2889e1d9de1fe611645310ba5b5048e817f44c451b5ec557c0e3b8e64049a437b82f901866ba4c1994d3c3caf02f81582f7409d10480df2c353eb63db4ec57671b2ac6c28fce842c605bae902ac5bb649f08199307458b542849d663809c9980a7c939b4f1f6d2eddf3dfe02f70ee4cf8956bf7a6a29a307939cd17eebdbcc80fb830bd545351a12c275375feaf3f690c52cc76dc7521ce87f621163b551a70e06d5bd3274bdc144f61f4ff8f1cdb2fcf97c67df1935057fdadaa23bf675892b4db841a63d49cd788c34498c70fb4ea787f3f8c1"
)
tx
,
err
=
CreateTx
(
"EncryptStorage"
,
&
oty
.
EncryptNotaryStorage
{
ContentHash
:
common
.
Sha256
(
c1
),
EncryptContent
:
c1
,
Nonce
:
ivs
[
0
]},
PrivKeyA
,
cfg
)
assert
.
Nil
(
t
,
err
)
Exec_Block
(
t
,
stateDB
,
kvdb
,
env
,
tx
)
txhash
=
common
.
ToHex
(
tx
.
Hash
())
reply
,
err
=
QueryStorageByKey
(
stateDB
,
kvdb
,
txhash
,
cfg
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
common
.
Sha256
(
c1
),
reply
.
GetEncryptStorage
()
.
ContentHash
)
assert
.
Equal
(
t
,
c1
,
reply
.
GetEncryptStorage
()
.
EncryptContent
)
tx
,
err
=
CreateTx
(
"EncryptAdd"
,
&
oty
.
EncryptNotaryAdd
{
Key
:
txhash
,
EncryptAdd
:
c2
},
PrivKeyA
,
cfg
)
assert
.
Nil
(
t
,
err
)
Exec_Block
(
t
,
stateDB
,
kvdb
,
env
,
tx
)
reply
,
err
=
QueryStorageByKey
(
stateDB
,
kvdb
,
txhash
,
cfg
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
c3
,
reply
.
GetEncryptStorage
()
.
EncryptContent
)
}
}
func
signTx
(
tx
*
types
.
Transaction
,
hexPrivKey
string
)
(
*
types
.
Transaction
,
error
)
{
func
signTx
(
tx
*
types
.
Transaction
,
hexPrivKey
string
)
(
*
types
.
Transaction
,
error
)
{
...
...
plugin/dapp/storage/executor/storagedb.go
View file @
1578dafa
...
@@ -2,6 +2,7 @@ package executor
...
@@ -2,6 +2,7 @@ package executor
import
(
import
(
"fmt"
"fmt"
"github.com/33cn/plugin/plugin/crypto/paillier"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common"
...
@@ -190,6 +191,49 @@ func (s *StorageAction) EncryptShareStorage(payload *ety.EncryptShareNotaryStora
...
@@ -190,6 +191,49 @@ func (s *StorageAction) EncryptShareStorage(payload *ety.EncryptShareNotaryStora
return
receipt
,
nil
return
receipt
,
nil
}
}
//EncryptAdd ...
func
(
s
*
StorageAction
)
EncryptAdd
(
payload
*
ety
.
EncryptNotaryAdd
)
(
*
types
.
Receipt
,
error
)
{
var
logs
[]
*
types
.
ReceiptLog
var
kvs
[]
*
types
.
KeyValue
cfg
:=
s
.
api
.
GetConfig
()
store
,
err
:=
QueryStorage
(
s
.
db
,
s
.
localdb
,
payload
.
Key
)
if
err
!=
nil
{
fmt
.
Errorf
(
"EncryptAdd.QueryStorage. err:%v"
,
err
)
return
nil
,
err
}
cipherText
:=
store
.
GetEncryptStorage
()
.
EncryptContent
res
,
err
:=
paillier
.
CiphertextAddBytes
(
cipherText
,
payload
.
EncryptAdd
)
if
err
!=
nil
{
fmt
.
Errorf
(
"EncryptAdd.CiphertextAddBytes. err:%v"
,
err
)
return
nil
,
err
}
store
.
GetEncryptStorage
()
.
EncryptContent
=
res
newStore
:=
&
ety
.
EncryptNotaryStorage
{
ContentHash
:
store
.
GetEncryptStorage
()
.
ContentHash
,
EncryptContent
:
res
,
Nonce
:
store
.
GetEncryptStorage
()
.
Nonce
,
Key
:
store
.
GetEncryptStorage
()
.
Key
,
Value
:
store
.
GetEncryptStorage
()
.
Value
,
}
if
cfg
.
IsDappFork
(
s
.
height
,
ety
.
StorageX
,
ety
.
ForkStorageLocalDB
)
{
stg
:=
&
ety
.
Storage
{
Value
:
&
ety
.
Storage_EncryptStorage
{
EncryptStorage
:
newStore
},
Ty
:
ety
.
TyEncryptStorageAction
}
log
:=
&
types
.
ReceiptLog
{
Ty
:
ety
.
TyEncryptAddLog
,
Log
:
types
.
Encode
(
stg
)}
logs
=
append
(
logs
,
log
)
}
else
{
log
:=
&
types
.
ReceiptLog
{
Ty
:
ety
.
TyEncryptAddLog
}
logs
=
append
(
logs
,
log
)
kvs
=
append
(
kvs
,
&
types
.
KeyValue
{
Key
:
Key
(
payload
.
Key
),
Value
:
types
.
Encode
(
newStore
)})
}
receipt
:=
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
kvs
,
Logs
:
logs
}
return
receipt
,
nil
}
//QueryStorageByTxHash ...
//QueryStorageByTxHash ...
func
QueryStorageByTxHash
(
db
dbm
.
KV
,
txhash
string
)
(
*
ety
.
Storage
,
error
)
{
func
QueryStorageByTxHash
(
db
dbm
.
KV
,
txhash
string
)
(
*
ety
.
Storage
,
error
)
{
data
,
err
:=
db
.
Get
(
Key
(
txhash
))
data
,
err
:=
db
.
Get
(
Key
(
txhash
))
...
...
plugin/dapp/storage/proto/storage.proto
View file @
1578dafa
...
@@ -8,8 +8,9 @@ message Storage {
...
@@ -8,8 +8,9 @@ message Storage {
LinkNotaryStorage
linkStorage
=
3
;
LinkNotaryStorage
linkStorage
=
3
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptNotaryAdd
encryptAdd
=
6
;
}
}
int32
ty
=
6
;
int32
ty
=
7
;
}
}
message
StorageAction
{
message
StorageAction
{
...
@@ -19,8 +20,9 @@ message StorageAction {
...
@@ -19,8 +20,9 @@ message StorageAction {
LinkNotaryStorage
linkStorage
=
3
;
LinkNotaryStorage
linkStorage
=
3
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptNotaryAdd
encryptAdd
=
6
;
}
}
int32
ty
=
6
;
int32
ty
=
7
;
}
}
// 内容存证模型
// 内容存证模型
message
ContentOnlyNotaryStorage
{
message
ContentOnlyNotaryStorage
{
...
@@ -85,6 +87,14 @@ message EncryptShareNotaryStorage {
...
@@ -85,6 +87,14 @@ message EncryptShareNotaryStorage {
string
value
=
5
;
string
value
=
5
;
}
}
// 加密存证数据运算
message
EncryptNotaryAdd
{
//源操作数存证索引
string
key
=
1
;
//待操作数据
bytes
encryptAdd
=
2
;
}
service
storage
{}
service
storage
{}
//根据txhash去状态数据库中查询存储内容
//根据txhash去状态数据库中查询存储内容
message
QueryStorage
{
message
QueryStorage
{
...
...
plugin/dapp/storage/rpc/types.go
View file @
1578dafa
...
@@ -2,7 +2,6 @@ package rpc
...
@@ -2,7 +2,6 @@ package rpc
import
(
import
(
rpctypes
"github.com/33cn/chain33/rpc/types"
rpctypes
"github.com/33cn/chain33/rpc/types"
storagetypes
"github.com/33cn/plugin/plugin/dapp/storage/types"
)
)
/*
/*
...
@@ -30,5 +29,5 @@ func Init(name string, s rpctypes.RPCServer) {
...
@@ -30,5 +29,5 @@ func Init(name string, s rpctypes.RPCServer) {
grpc
:=
&
Grpc
{
channelClient
:
cli
}
grpc
:=
&
Grpc
{
channelClient
:
cli
}
cli
.
Init
(
name
,
s
,
&
Jrpc
{
cli
:
cli
},
grpc
)
cli
.
Init
(
name
,
s
,
&
Jrpc
{
cli
:
cli
},
grpc
)
//存在grpc service时注册grpc server,需要生成对应的pb.go文件
//存在grpc service时注册grpc server,需要生成对应的pb.go文件
storagetypes
.
RegisterStorageServer
(
s
.
GRPC
(),
grpc
)
//
storagetypes.RegisterStorageServer(s.GRPC(), grpc)
}
}
plugin/dapp/storage/types/storage.go
View file @
1578dafa
...
@@ -20,12 +20,14 @@ const (
...
@@ -20,12 +20,14 @@ const (
TyLinkStorageAction
TyLinkStorageAction
TyEncryptStorageAction
TyEncryptStorageAction
TyEncryptShareStorageAction
TyEncryptShareStorageAction
TyEncryptAddAction
NameContentStorageAction
=
"ContentStorage"
NameContentStorageAction
=
"ContentStorage"
NameHashStorageAction
=
"HashStorage"
NameHashStorageAction
=
"HashStorage"
NameLinkStorageAction
=
"LinkStorage"
NameLinkStorageAction
=
"LinkStorage"
NameEncryptStorageAction
=
"EncryptStorage"
NameEncryptStorageAction
=
"EncryptStorage"
NameEncryptShareStorageAction
=
"EncryptShareStorage"
NameEncryptShareStorageAction
=
"EncryptShareStorage"
NameEncryptAddAction
=
"EncryptAdd"
FuncNameQueryStorage
=
"QueryStorage"
FuncNameQueryStorage
=
"QueryStorage"
FuncNameBatchQueryStorage
=
"BatchQueryStorage"
FuncNameBatchQueryStorage
=
"BatchQueryStorage"
...
@@ -39,6 +41,7 @@ const (
...
@@ -39,6 +41,7 @@ const (
TyLinkStorageLog
TyLinkStorageLog
TyEncryptStorageLog
TyEncryptStorageLog
TyEncryptShareStorageLog
TyEncryptShareStorageLog
TyEncryptAddLog
)
)
//storage op
//storage op
...
@@ -61,6 +64,7 @@ var (
...
@@ -61,6 +64,7 @@ var (
NameLinkStorageAction
:
TyLinkStorageAction
,
NameLinkStorageAction
:
TyLinkStorageAction
,
NameEncryptStorageAction
:
TyEncryptStorageAction
,
NameEncryptStorageAction
:
TyEncryptStorageAction
,
NameEncryptShareStorageAction
:
TyEncryptShareStorageAction
,
NameEncryptShareStorageAction
:
TyEncryptShareStorageAction
,
NameEncryptAddAction
:
TyEncryptAddAction
,
}
}
//定义log的id和具体log类型及名称,填入具体自定义log类型
//定义log的id和具体log类型及名称,填入具体自定义log类型
logMap
=
map
[
int64
]
*
types
.
LogInfo
{
logMap
=
map
[
int64
]
*
types
.
LogInfo
{
...
@@ -69,6 +73,7 @@ var (
...
@@ -69,6 +73,7 @@ var (
TyLinkStorageLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogLinkStorage"
},
TyLinkStorageLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogLinkStorage"
},
TyEncryptStorageLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogEncryptStorage"
},
TyEncryptStorageLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogEncryptStorage"
},
TyEncryptShareStorageLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogEncryptShareStorage"
},
TyEncryptShareStorageLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogEncryptShareStorage"
},
TyEncryptAddLog
:
{
Ty
:
reflect
.
TypeOf
(
Storage
{}),
Name
:
"LogEncryptAdd"
},
}
}
)
)
...
...
plugin/dapp/storage/types/storage.pb.go
View file @
1578dafa
...
@@ -4,12 +4,9 @@
...
@@ -4,12 +4,9 @@
package
types
package
types
import
(
import
(
context
"context"
fmt
"fmt"
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc
"
math
"math
"
)
)
// Reference imports to suppress errors if they are not otherwise used.
// Reference imports to suppress errors if they are not otherwise used.
...
@@ -31,8 +28,9 @@ type Storage struct {
...
@@ -31,8 +28,9 @@ type Storage struct {
// *Storage_LinkStorage
// *Storage_LinkStorage
// *Storage_EncryptStorage
// *Storage_EncryptStorage
// *Storage_EncryptShareStorage
// *Storage_EncryptShareStorage
// *Storage_EncryptAdd
Value
isStorage_Value
`protobuf_oneof:"value"`
Value
isStorage_Value
`protobuf_oneof:"value"`
Ty
int32
`protobuf:"varint,
6
,opt,name=ty,proto3" json:"ty,omitempty"`
Ty
int32
`protobuf:"varint,
7
,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
@@ -87,6 +85,10 @@ type Storage_EncryptShareStorage struct {
...
@@ -87,6 +85,10 @@ type Storage_EncryptShareStorage struct {
EncryptShareStorage
*
EncryptShareNotaryStorage
`protobuf:"bytes,5,opt,name=encryptShareStorage,proto3,oneof"`
EncryptShareStorage
*
EncryptShareNotaryStorage
`protobuf:"bytes,5,opt,name=encryptShareStorage,proto3,oneof"`
}
}
type
Storage_EncryptAdd
struct
{
EncryptAdd
*
EncryptNotaryAdd
`protobuf:"bytes,6,opt,name=encryptAdd,proto3,oneof"`
}
func
(
*
Storage_ContentStorage
)
isStorage_Value
()
{}
func
(
*
Storage_ContentStorage
)
isStorage_Value
()
{}
func
(
*
Storage_HashStorage
)
isStorage_Value
()
{}
func
(
*
Storage_HashStorage
)
isStorage_Value
()
{}
...
@@ -97,6 +99,8 @@ func (*Storage_EncryptStorage) isStorage_Value() {}
...
@@ -97,6 +99,8 @@ func (*Storage_EncryptStorage) isStorage_Value() {}
func
(
*
Storage_EncryptShareStorage
)
isStorage_Value
()
{}
func
(
*
Storage_EncryptShareStorage
)
isStorage_Value
()
{}
func
(
*
Storage_EncryptAdd
)
isStorage_Value
()
{}
func
(
m
*
Storage
)
GetValue
()
isStorage_Value
{
func
(
m
*
Storage
)
GetValue
()
isStorage_Value
{
if
m
!=
nil
{
if
m
!=
nil
{
return
m
.
Value
return
m
.
Value
...
@@ -139,6 +143,13 @@ func (m *Storage) GetEncryptShareStorage() *EncryptShareNotaryStorage {
...
@@ -139,6 +143,13 @@ func (m *Storage) GetEncryptShareStorage() *EncryptShareNotaryStorage {
return
nil
return
nil
}
}
func
(
m
*
Storage
)
GetEncryptAdd
()
*
EncryptNotaryAdd
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
Storage_EncryptAdd
);
ok
{
return
x
.
EncryptAdd
}
return
nil
}
func
(
m
*
Storage
)
GetTy
()
int32
{
func
(
m
*
Storage
)
GetTy
()
int32
{
if
m
!=
nil
{
if
m
!=
nil
{
return
m
.
Ty
return
m
.
Ty
...
@@ -154,6 +165,7 @@ func (*Storage) XXX_OneofWrappers() []interface{} {
...
@@ -154,6 +165,7 @@ func (*Storage) XXX_OneofWrappers() []interface{} {
(
*
Storage_LinkStorage
)(
nil
),
(
*
Storage_LinkStorage
)(
nil
),
(
*
Storage_EncryptStorage
)(
nil
),
(
*
Storage_EncryptStorage
)(
nil
),
(
*
Storage_EncryptShareStorage
)(
nil
),
(
*
Storage_EncryptShareStorage
)(
nil
),
(
*
Storage_EncryptAdd
)(
nil
),
}
}
}
}
...
@@ -164,8 +176,9 @@ type StorageAction struct {
...
@@ -164,8 +176,9 @@ type StorageAction struct {
// *StorageAction_LinkStorage
// *StorageAction_LinkStorage
// *StorageAction_EncryptStorage
// *StorageAction_EncryptStorage
// *StorageAction_EncryptShareStorage
// *StorageAction_EncryptShareStorage
// *StorageAction_EncryptAdd
Value
isStorageAction_Value
`protobuf_oneof:"value"`
Value
isStorageAction_Value
`protobuf_oneof:"value"`
Ty
int32
`protobuf:"varint,
6
,opt,name=ty,proto3" json:"ty,omitempty"`
Ty
int32
`protobuf:"varint,
7
,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
@@ -220,6 +233,10 @@ type StorageAction_EncryptShareStorage struct {
...
@@ -220,6 +233,10 @@ type StorageAction_EncryptShareStorage struct {
EncryptShareStorage
*
EncryptShareNotaryStorage
`protobuf:"bytes,5,opt,name=encryptShareStorage,proto3,oneof"`
EncryptShareStorage
*
EncryptShareNotaryStorage
`protobuf:"bytes,5,opt,name=encryptShareStorage,proto3,oneof"`
}
}
type
StorageAction_EncryptAdd
struct
{
EncryptAdd
*
EncryptNotaryAdd
`protobuf:"bytes,6,opt,name=encryptAdd,proto3,oneof"`
}
func
(
*
StorageAction_ContentStorage
)
isStorageAction_Value
()
{}
func
(
*
StorageAction_ContentStorage
)
isStorageAction_Value
()
{}
func
(
*
StorageAction_HashStorage
)
isStorageAction_Value
()
{}
func
(
*
StorageAction_HashStorage
)
isStorageAction_Value
()
{}
...
@@ -230,6 +247,8 @@ func (*StorageAction_EncryptStorage) isStorageAction_Value() {}
...
@@ -230,6 +247,8 @@ func (*StorageAction_EncryptStorage) isStorageAction_Value() {}
func
(
*
StorageAction_EncryptShareStorage
)
isStorageAction_Value
()
{}
func
(
*
StorageAction_EncryptShareStorage
)
isStorageAction_Value
()
{}
func
(
*
StorageAction_EncryptAdd
)
isStorageAction_Value
()
{}
func
(
m
*
StorageAction
)
GetValue
()
isStorageAction_Value
{
func
(
m
*
StorageAction
)
GetValue
()
isStorageAction_Value
{
if
m
!=
nil
{
if
m
!=
nil
{
return
m
.
Value
return
m
.
Value
...
@@ -272,6 +291,13 @@ func (m *StorageAction) GetEncryptShareStorage() *EncryptShareNotaryStorage {
...
@@ -272,6 +291,13 @@ func (m *StorageAction) GetEncryptShareStorage() *EncryptShareNotaryStorage {
return
nil
return
nil
}
}
func
(
m
*
StorageAction
)
GetEncryptAdd
()
*
EncryptNotaryAdd
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
StorageAction_EncryptAdd
);
ok
{
return
x
.
EncryptAdd
}
return
nil
}
func
(
m
*
StorageAction
)
GetTy
()
int32
{
func
(
m
*
StorageAction
)
GetTy
()
int32
{
if
m
!=
nil
{
if
m
!=
nil
{
return
m
.
Ty
return
m
.
Ty
...
@@ -287,6 +313,7 @@ func (*StorageAction) XXX_OneofWrappers() []interface{} {
...
@@ -287,6 +313,7 @@ func (*StorageAction) XXX_OneofWrappers() []interface{} {
(
*
StorageAction_LinkStorage
)(
nil
),
(
*
StorageAction_LinkStorage
)(
nil
),
(
*
StorageAction_EncryptStorage
)(
nil
),
(
*
StorageAction_EncryptStorage
)(
nil
),
(
*
StorageAction_EncryptShareStorage
)(
nil
),
(
*
StorageAction_EncryptShareStorage
)(
nil
),
(
*
StorageAction_EncryptAdd
)(
nil
),
}
}
}
}
...
@@ -639,6 +666,56 @@ func (m *EncryptShareNotaryStorage) GetValue() string {
...
@@ -639,6 +666,56 @@ func (m *EncryptShareNotaryStorage) GetValue() string {
return
""
return
""
}
}
// 加密存证数据运算
type
EncryptNotaryAdd
struct
{
//源操作数存证索引
Key
string
`protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
//待操作数据
EncryptAdd
[]
byte
`protobuf:"bytes,2,opt,name=encryptAdd,proto3" json:"encryptAdd,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
}
func
(
m
*
EncryptNotaryAdd
)
Reset
()
{
*
m
=
EncryptNotaryAdd
{}
}
func
(
m
*
EncryptNotaryAdd
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
EncryptNotaryAdd
)
ProtoMessage
()
{}
func
(
*
EncryptNotaryAdd
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
7
}
}
func
(
m
*
EncryptNotaryAdd
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_EncryptNotaryAdd
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
EncryptNotaryAdd
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_EncryptNotaryAdd
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
EncryptNotaryAdd
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_EncryptNotaryAdd
.
Merge
(
m
,
src
)
}
func
(
m
*
EncryptNotaryAdd
)
XXX_Size
()
int
{
return
xxx_messageInfo_EncryptNotaryAdd
.
Size
(
m
)
}
func
(
m
*
EncryptNotaryAdd
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_EncryptNotaryAdd
.
DiscardUnknown
(
m
)
}
var
xxx_messageInfo_EncryptNotaryAdd
proto
.
InternalMessageInfo
func
(
m
*
EncryptNotaryAdd
)
GetKey
()
string
{
if
m
!=
nil
{
return
m
.
Key
}
return
""
}
func
(
m
*
EncryptNotaryAdd
)
GetEncryptAdd
()
[]
byte
{
if
m
!=
nil
{
return
m
.
EncryptAdd
}
return
nil
}
//根据txhash去状态数据库中查询存储内容
//根据txhash去状态数据库中查询存储内容
type
QueryStorage
struct
{
type
QueryStorage
struct
{
TxHash
string
`protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"`
TxHash
string
`protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"`
...
@@ -651,7 +728,7 @@ func (m *QueryStorage) Reset() { *m = QueryStorage{} }
...
@@ -651,7 +728,7 @@ func (m *QueryStorage) Reset() { *m = QueryStorage{} }
func
(
m
*
QueryStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
QueryStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
QueryStorage
)
ProtoMessage
()
{}
func
(
*
QueryStorage
)
ProtoMessage
()
{}
func
(
*
QueryStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
QueryStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
7
}
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
8
}
}
}
func
(
m
*
QueryStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
QueryStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -691,7 +768,7 @@ func (m *BatchQueryStorage) Reset() { *m = BatchQueryStorage{} }
...
@@ -691,7 +768,7 @@ func (m *BatchQueryStorage) Reset() { *m = BatchQueryStorage{} }
func
(
m
*
BatchQueryStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
BatchQueryStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
BatchQueryStorage
)
ProtoMessage
()
{}
func
(
*
BatchQueryStorage
)
ProtoMessage
()
{}
func
(
*
BatchQueryStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
BatchQueryStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
8
}
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
9
}
}
}
func
(
m
*
BatchQueryStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
BatchQueryStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -730,7 +807,7 @@ func (m *BatchReplyStorage) Reset() { *m = BatchReplyStorage{} }
...
@@ -730,7 +807,7 @@ func (m *BatchReplyStorage) Reset() { *m = BatchReplyStorage{} }
func
(
m
*
BatchReplyStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
BatchReplyStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
BatchReplyStorage
)
ProtoMessage
()
{}
func
(
*
BatchReplyStorage
)
ProtoMessage
()
{}
func
(
*
BatchReplyStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
BatchReplyStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
9
}
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
10
}
}
}
func
(
m
*
BatchReplyStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
BatchReplyStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -768,7 +845,7 @@ func (m *ReceiptStorage) Reset() { *m = ReceiptStorage{} }
...
@@ -768,7 +845,7 @@ func (m *ReceiptStorage) Reset() { *m = ReceiptStorage{} }
func
(
m
*
ReceiptStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
ReceiptStorage
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
ReceiptStorage
)
ProtoMessage
()
{}
func
(
*
ReceiptStorage
)
ProtoMessage
()
{}
func
(
*
ReceiptStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
ReceiptStorage
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
1
0
}
return
fileDescriptor_0d2c4ccf1453ffdb
,
[]
int
{
1
1
}
}
}
func
(
m
*
ReceiptStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
ReceiptStorage
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -797,89 +874,48 @@ func init() {
...
@@ -797,89 +874,48 @@ func init() {
proto
.
RegisterType
((
*
LinkNotaryStorage
)(
nil
),
"types.LinkNotaryStorage"
)
proto
.
RegisterType
((
*
LinkNotaryStorage
)(
nil
),
"types.LinkNotaryStorage"
)
proto
.
RegisterType
((
*
EncryptNotaryStorage
)(
nil
),
"types.EncryptNotaryStorage"
)
proto
.
RegisterType
((
*
EncryptNotaryStorage
)(
nil
),
"types.EncryptNotaryStorage"
)
proto
.
RegisterType
((
*
EncryptShareNotaryStorage
)(
nil
),
"types.EncryptShareNotaryStorage"
)
proto
.
RegisterType
((
*
EncryptShareNotaryStorage
)(
nil
),
"types.EncryptShareNotaryStorage"
)
proto
.
RegisterType
((
*
EncryptNotaryAdd
)(
nil
),
"types.EncryptNotaryAdd"
)
proto
.
RegisterType
((
*
QueryStorage
)(
nil
),
"types.QueryStorage"
)
proto
.
RegisterType
((
*
QueryStorage
)(
nil
),
"types.QueryStorage"
)
proto
.
RegisterType
((
*
BatchQueryStorage
)(
nil
),
"types.BatchQueryStorage"
)
proto
.
RegisterType
((
*
BatchQueryStorage
)(
nil
),
"types.BatchQueryStorage"
)
proto
.
RegisterType
((
*
BatchReplyStorage
)(
nil
),
"types.BatchReplyStorage"
)
proto
.
RegisterType
((
*
BatchReplyStorage
)(
nil
),
"types.BatchReplyStorage"
)
proto
.
RegisterType
((
*
ReceiptStorage
)(
nil
),
"types.ReceiptStorage"
)
proto
.
RegisterType
((
*
ReceiptStorage
)(
nil
),
"types.ReceiptStorage"
)
}
}
func
init
()
{
func
init
()
{
proto
.
RegisterFile
(
"storage.proto"
,
fileDescriptor_0d2c4ccf1453ffdb
)
}
proto
.
RegisterFile
(
"storage.proto"
,
fileDescriptor_0d2c4ccf1453ffdb
)
}
var
fileDescriptor_0d2c4ccf1453ffdb
=
[]
byte
{
var
fileDescriptor_0d2c4ccf1453ffdb
=
[]
byte
{
// 488 bytes of a gzipped FileDescriptorProto
// 528 bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xec
,
0x55
,
0xc1
,
0x8a
,
0xd4
,
0x40
,
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xec
,
0x95
,
0x4d
,
0x8b
,
0xd3
,
0x40
,
0x10
,
0x35
,
0xc9
,
0x64
,
0x62
,
0x2a
,
0xb3
,
0x61
,
0xb7
,
0x5d
,
0x97
,
0x88
,
0x82
,
0x21
,
0x87
,
0x65
,
0x18
,
0xc7
,
0x37
,
0x4d
,
0xd3
,
0x98
,
0x27
,
0xdd
,
0xd0
,
0x1d
,
0xd7
,
0x35
,
0xa2
,
0x68
,
0xc8
,
0x61
,
0x10
,
0x9c
,
0xc3
,
0x78
,
0x15
,
0xd4
,
0x95
,
0x85
,
0x11
,
0x45
,
0xb1
,
0xd7
,
0x1f
,
0xc8
,
0x86
,
0xc6
,
0x29
,
0x82
,
0x3d
,
0xd4
,
0x93
,
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
,
0x57
,
0x08
,
0xa7
,
0xac
,
0x2c
,
0x0c
,
0xfc
,
0x19
,
0xdc
,
0xc7
,
0x47
,
0xa1
,
0xc3
,
0x07
,
0x77
,
0xd2
,
0xb2
,
0x84
,
0xe7
,
0x30
,
0xfe
,
0xbc
,
0x65
,
0xbb
,
0xf9
,
0xce
,
0x60
,
0x24
,
0xbf
,
0x37
,
0xeb
,
0x10
,
0x7f
,
0x20
,
0x44
,
0x50
,
0x93
,
0x4f
,
0x8e
,
0x21
,
0xa4
,
0x2c
,
0x63
,
0x5b
,
0xf3
,
0x27
,
0xa3
,
0x39
,
0x14
,
0x6f
,
0xe1
,
0x33
,
0x38
,
0xb9
,
0x88
,
0x64
,
0x9c
,
0x74
,
0x82
,
0x7d
,
0xb0
,
0x6b
,
0xae
,
0x7d
,
0xf0
,
0x30
,
0x7b
,
0x3d
,
0x57
,
0x6f
,
0xca
,
0x8b
,
0x3f
,
0x01
,
0x00
,
0x00
,
0xff
,
0xff
,
0x77
,
0xe1
,
0x1b
,
0x81
,
0x39
,
0x75
,
0xa8
,
0xbe
,
0x86
,
0xaf
,
0x30
,
0x9c
,
0xb2
,
0x2c
,
0x6d
,
0xc2
,
0x38
,
0xc7
,
0xa7
,
0x39
,
0x64
,
0x06
,
0x00
,
0x00
,
0x9f
,
0xc2
,
0x1d
,
0xfc
,
0xa0
,
0xd5
,
0xf1
,
0xee
,
0xdc
,
0xc3
,
0x1f
,
0x1d
,
0x46
,
0xd0
,
0xc6
,
0x1f
,
}
0x4e
,
0xc0
,
0xa3
,
0x2c
,
0x66
,
0xeb
,
0xe6
,
0xaf
,
0x60
,
0xee
,
0x80
,
0x8d
,
0xde
,
0xeb
,
0x91
,
0xfa
,
0x1e
,
0x3e
,
0xff
,
0x13
,
0x00
,
0x00
,
0xff
,
0xff
,
0x66
,
0xc3
,
0x4e
,
0x48
,
0x20
,
0x07
,
0x00
,
0x00
,
// Reference imports to suppress errors if they are not otherwise used.
var
_
context
.
Context
var
_
grpc
.
ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const
_
=
grpc
.
SupportPackageIsVersion6
// StorageClient is the client API for Storage service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type
StorageClient
interface
{
}
type
storageClient
struct
{
cc
grpc
.
ClientConnInterface
}
func
NewStorageClient
(
cc
grpc
.
ClientConnInterface
)
StorageClient
{
return
&
storageClient
{
cc
}
}
// StorageServer is the server API for Storage service.
type
StorageServer
interface
{
}
// UnimplementedStorageServer can be embedded to have forward compatible implementations.
type
UnimplementedStorageServer
struct
{
}
func
RegisterStorageServer
(
s
*
grpc
.
Server
,
srv
StorageServer
)
{
s
.
RegisterService
(
&
_Storage_serviceDesc
,
srv
)
}
var
_Storage_serviceDesc
=
grpc
.
ServiceDesc
{
ServiceName
:
"types.storage"
,
HandlerType
:
(
*
StorageServer
)(
nil
),
Methods
:
[]
grpc
.
MethodDesc
{},
Streams
:
[]
grpc
.
StreamDesc
{},
Metadata
:
"storage.proto"
,
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment