Auto merge of #4400 - str4d:sync-librustzcash, r=ebfull
Synchronize Rust code with librustzcash crate This PR pulls in all changes made since librustzcash 0.2.0 (merged in #4160). All future changes to the librustzcash crate will be made in this repository.
This commit is contained in:
commit
f8aba7f668
|
@ -49,22 +49,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "bellman"
|
||||
version = "0.2.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2s_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"group 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"group 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bigint"
|
||||
version = "4.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bit-vec"
|
||||
version = "0.4.4"
|
||||
|
@ -206,6 +215,11 @@ dependencies = [
|
|||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crunchy"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "crypto_api"
|
||||
version = "0.2.2"
|
||||
|
@ -243,17 +257,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff_derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff_derive 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff_derive"
|
||||
version = "0.4.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -310,10 +324,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.2.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -337,17 +351,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "librustzcash"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"bellman 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bellman 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2s_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_primitives 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_proofs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_history 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_primitives 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_proofs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -413,12 +427,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "pairing"
|
||||
version = "0.15.0"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"group 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"group 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
@ -569,9 +583,19 @@ name = "winapi-x86_64-pc-windows-gnu"
|
|||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "zcash_history"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zcash_primitives"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -579,12 +603,12 @@ dependencies = [
|
|||
"blake2s_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crypto_api_chachapoly 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fpe 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -592,17 +616,17 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zcash_proofs"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bellman 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bellman 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_primitives 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_primitives 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[metadata]
|
||||
|
@ -612,7 +636,8 @@ dependencies = [
|
|||
"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
|
||||
"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba"
|
||||
"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
|
||||
"checksum bellman 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a8b3143b11715f8105882a1df9b3d36386aa8e3a6cfd573a2974c9ea9a22fea"
|
||||
"checksum bellman 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2be536193834affcd8a6d362963e66dec8c6bca4d2009f5bac55ec9002776ff2"
|
||||
"checksum bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebecac13b3c745150d7b6c3ea7572d372f09d627c2077e893bf26c5c7f70d282"
|
||||
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
|
||||
"checksum blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5850aeee1552f495dd0250014cf64b82b7c8879a89d83b33bbdace2cc4f63182"
|
||||
"checksum blake2s_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "979da0ce13c897d6be19e005ea77ac12b0fea0157aeeee7feb8c49f91386f0ea"
|
||||
|
@ -630,19 +655,20 @@ dependencies = [
|
|||
"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9"
|
||||
"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b"
|
||||
"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
|
||||
"checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda"
|
||||
"checksum crypto_api 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f855e87e75a4799e18b8529178adcde6fd4f97c1449ff4821e747ff728bb102"
|
||||
"checksum crypto_api_chachapoly 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "95b2ad7cab08fd71addba81df5077c49df208effdfb3118a1519f9cdeac5aaf2"
|
||||
"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
|
||||
"checksum directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72d337a64190607d4fcca2cb78982c5dd57f4916e19696b48a575fa746b6cb0f"
|
||||
"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
|
||||
"checksum ff 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44b4c77ad8a724f1ebb882af5d2d7a2ab62f4d63c8e401d40ab0de1d75262ea3"
|
||||
"checksum ff_derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9cb38a53026415988765d8d7d81b680187a77a486ba9e249dbccd5a3e74429b"
|
||||
"checksum ff 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b967a3ee6ae993f0094174257d404a5818f58be79d67a1aea1ec8996d28906"
|
||||
"checksum ff_derive 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3776aaf60a45037a9c3cabdd8542b38693acaa3e241ff957181b72579d29feb"
|
||||
"checksum fpe 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "21988a326139165b75e3196bc6962ca638e5fb0c95102fbf152a3743174b01e4"
|
||||
"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
|
||||
"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
|
||||
"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
|
||||
"checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571"
|
||||
"checksum group 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8cbdfc48f95bef47e3daf3b9d552a1dde6311e3a5fefa43e16c59f651d56fe5b"
|
||||
"checksum group 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f15be54742789e36f03307c8fdf0621201e1345e94f1387282024178b5e9ec8c"
|
||||
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
|
||||
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
|
||||
|
@ -654,7 +680,7 @@ dependencies = [
|
|||
"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"
|
||||
"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
|
||||
"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
|
||||
"checksum pairing 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ec7b64119b36952d5a0c7baf959ef061a07665751706f046f9f6f0f9d83d459"
|
||||
"checksum pairing 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8290dea210a712682cd65031dc2b34fd132cf2729def3df7ee08f0737ff5ed6"
|
||||
"checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b"
|
||||
"checksum proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e98a83a9f9b331f54b924e68a66acb1bb35cb01fb0a23645139967abefb697e8"
|
||||
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
|
||||
|
@ -675,5 +701,6 @@ dependencies = [
|
|||
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
|
||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
"checksum zcash_primitives 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9530749bc784c4ca0d7bf000333cec29acf94f1875ad8db088e12dfee1095d13"
|
||||
"checksum zcash_proofs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f12228d3bff81779e848bc7e7a68f282c717ef2f67a69e6477f4667fbb06078"
|
||||
"checksum zcash_history 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abfbab9accba014bbf3098d5aa66c1714d0db4abe25b999b8400bbd626ccd2f4"
|
||||
"checksum zcash_primitives 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f33b9e4f3b4db97234fc79ea67b12f2d5778bde8f3eab6dbba52eb54c596585"
|
||||
"checksum zcash_proofs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2011f78f14d5121248d3b4f921434207b1d870fb3bf2efc7d784cae79b19bfbc"
|
||||
|
|
12
Cargo.toml
12
Cargo.toml
|
@ -20,14 +20,14 @@ path = "src/rust/src/rustzcash.rs"
|
|||
crate-type = ["staticlib"]
|
||||
|
||||
[dependencies]
|
||||
bellman = "0.2.0"
|
||||
bellman = "0.6"
|
||||
blake2b_simd = "0.5"
|
||||
blake2s_simd = "0.5"
|
||||
ff = "0.5.0"
|
||||
ff = "0.6"
|
||||
libc = "0.2"
|
||||
pairing = "0.15.0"
|
||||
pairing = "0.16"
|
||||
lazy_static = "1"
|
||||
byteorder = "1"
|
||||
rand_core = "0.5.1"
|
||||
zcash_primitives = "0.1.0"
|
||||
zcash_proofs = "0.1.0"
|
||||
zcash_history = "0.2"
|
||||
zcash_primitives = "0.2"
|
||||
zcash_proofs = "0.2"
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_bellman
|
||||
$(package)_crate_name=bellman
|
||||
$(package)_version=0.2.0
|
||||
$(package)_version=0.6.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=8a8b3143b11715f8105882a1df9b3d36386aa8e3a6cfd573a2974c9ea9a22fea
|
||||
$(package)_sha256_hash=2be536193834affcd8a6d362963e66dec8c6bca4d2009f5bac55ec9002776ff2
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package=crate_bigint
|
||||
$(package)_crate_name=bigint
|
||||
$(package)_version=4.4.1
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=ebecac13b3c745150d7b6c3ea7572d372f09d627c2077e893bf26c5c7f70d282
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
$(call generate_crate_checksum,$(package))
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(call vendor_crate_source,$(package))
|
||||
endef
|
|
@ -0,0 +1,15 @@
|
|||
package=crate_crunchy
|
||||
$(package)_crate_name=crunchy
|
||||
$(package)_version=0.1.6
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
$(call generate_crate_checksum,$(package))
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(call vendor_crate_source,$(package))
|
||||
endef
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_ff
|
||||
$(package)_crate_name=ff
|
||||
$(package)_version=0.5.0
|
||||
$(package)_version=0.6.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=44b4c77ad8a724f1ebb882af5d2d7a2ab62f4d63c8e401d40ab0de1d75262ea3
|
||||
$(package)_sha256_hash=c4b967a3ee6ae993f0094174257d404a5818f58be79d67a1aea1ec8996d28906
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_ff_derive
|
||||
$(package)_crate_name=ff_derive
|
||||
$(package)_version=0.4.0
|
||||
$(package)_version=0.6.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=a9cb38a53026415988765d8d7d81b680187a77a486ba9e249dbccd5a3e74429b
|
||||
$(package)_sha256_hash=a3776aaf60a45037a9c3cabdd8542b38693acaa3e241ff957181b72579d29feb
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_group
|
||||
$(package)_crate_name=group
|
||||
$(package)_version=0.2.0
|
||||
$(package)_version=0.6.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=8cbdfc48f95bef47e3daf3b9d552a1dde6311e3a5fefa43e16c59f651d56fe5b
|
||||
$(package)_sha256_hash=f15be54742789e36f03307c8fdf0621201e1345e94f1387282024178b5e9ec8c
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_pairing
|
||||
$(package)_crate_name=pairing
|
||||
$(package)_version=0.15.0
|
||||
$(package)_version=0.16.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=0ec7b64119b36952d5a0c7baf959ef061a07665751706f046f9f6f0f9d83d459
|
||||
$(package)_sha256_hash=b8290dea210a712682cd65031dc2b34fd132cf2729def3df7ee08f0737ff5ed6
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package=crate_zcash_history
|
||||
$(package)_crate_name=zcash_history
|
||||
$(package)_version=0.2.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=abfbab9accba014bbf3098d5aa66c1714d0db4abe25b999b8400bbd626ccd2f4
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
$(call generate_crate_checksum,$(package))
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(call vendor_crate_source,$(package))
|
||||
endef
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_zcash_primitives
|
||||
$(package)_crate_name=zcash_primitives
|
||||
$(package)_version=0.1.0
|
||||
$(package)_version=0.2.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=9530749bc784c4ca0d7bf000333cec29acf94f1875ad8db088e12dfee1095d13
|
||||
$(package)_sha256_hash=8f33b9e4f3b4db97234fc79ea67b12f2d5778bde8f3eab6dbba52eb54c596585
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package=crate_zcash_proofs
|
||||
$(package)_crate_name=zcash_proofs
|
||||
$(package)_version=0.1.0
|
||||
$(package)_version=0.2.0
|
||||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
|
||||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
|
||||
$(package)_sha256_hash=6f12228d3bff81779e848bc7e7a68f282c717ef2f67a69e6477f4667fbb06078
|
||||
$(package)_sha256_hash=2011f78f14d5121248d3b4f921434207b1d870fb3bf2efc7d784cae79b19bfbc
|
||||
$(package)_crate_versioned_name=$($(package)_crate_name)
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -6,6 +6,7 @@ rust_crates := \
|
|||
crate_arrayvec \
|
||||
crate_autocfg \
|
||||
crate_bellman \
|
||||
crate_bigint \
|
||||
crate_bit_vec \
|
||||
crate_blake2b_simd \
|
||||
crate_blake2s_simd \
|
||||
|
@ -23,6 +24,7 @@ rust_crates := \
|
|||
crate_crossbeam_queue \
|
||||
crate_crossbeam_utils \
|
||||
crate_crossbeam \
|
||||
crate_crunchy \
|
||||
crate_crypto_api_chachapoly \
|
||||
crate_crypto_api \
|
||||
crate_digest \
|
||||
|
@ -68,6 +70,7 @@ rust_crates := \
|
|||
crate_winapi_i686_pc_windows_gnu \
|
||||
crate_winapi \
|
||||
crate_winapi_x86_64_pc_windows_gnu \
|
||||
crate_zcash_history \
|
||||
crate_zcash_primitives \
|
||||
crate_zcash_proofs
|
||||
rust_packages := rust $(rust_crates)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package=rust
|
||||
$(package)_version=1.36.0
|
||||
$(package)_version=1.42.0
|
||||
$(package)_download_path=https://static.rust-lang.org/dist
|
||||
$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
|
||||
$(package)_sha256_hash_linux=15e592ec52f14a0586dcebc87a957e472c4544e07359314f6354e2b8bd284c55
|
||||
$(package)_sha256_hash_linux=7d1e07ad9c8a33d8d039def7c0a131c5917aa3ea0af3d0cc399c6faf7b789052
|
||||
$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
|
||||
$(package)_sha256_hash_darwin=91f151ec7e24f5b0645948d439fc25172ec4012f0584dd16c3fb1acb709aa325
|
||||
$(package)_sha256_hash_darwin=db1055c46e0d54b99da05e88c71fea21b3897e74a4f5ff9390e934f3f050c0a8
|
||||
$(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz
|
||||
$(package)_sha256_hash_freebsd=eeeb1e9d0d7823c55f00f434789696e7249f465ba5966a5ab479040e3912c0e7
|
||||
$(package)_sha256_hash_freebsd=230bcf17e4383fba85d3c87fe25d17737459fe561a5f4668fe70dcac2da4e17c
|
||||
|
||||
# Mapping from GCC canonical hosts to Rust targets
|
||||
# If a mapping is not present, we assume they are identical
|
||||
|
@ -14,9 +14,9 @@ $(package)_rust_target_x86_64-apple-darwin11=x86_64-apple-darwin
|
|||
$(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu
|
||||
|
||||
# Mapping from Rust targets to SHA-256 hashes
|
||||
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=22bfc32b5003c3d5259babb202f3f66be16fa6f3c75c20f429a16d7ef5eb1928
|
||||
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=7c6806809e010e5fba1780007ecff5c31f0ad2fcac1b414b98ca3baa0fb41b36
|
||||
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=3657c361f5d6048c2cb814f1773fece07b840276d60f012d0bf70993fa95a77e
|
||||
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=1343f51fc87049327233cee8941629c3d7dfdc425d359385f93665de3d46711b
|
||||
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=1d61e9ed5d29e1bb4c18e13d551c6d856c73fb8b410053245dc6e0d3b3a0e92c
|
||||
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=8a8389f3860df6f42fbf8b76a62ddc7b9b6fe6d0fb526dcfc42faab1005bfb6d
|
||||
|
||||
ifneq ($(canonical_host),$(build))
|
||||
$(package)_rust_target=$(if $($(package)_rust_target_$(canonical_host)),$($(package)_rust_target_$(canonical_host)),$(canonical_host))
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.36.0
|
||||
1.42.0
|
||||
|
|
|
@ -307,6 +307,33 @@ extern "C" {
|
|||
unsigned char *j_ret,
|
||||
unsigned char *addr_ret
|
||||
);
|
||||
|
||||
uint32_t librustzcash_mmr_append(
|
||||
uint32_t cbranch,
|
||||
uint32_t t_len,
|
||||
const uint32_t *ni_ptr,
|
||||
const unsigned char *n_ptr,
|
||||
size_t p_len,
|
||||
const unsigned char *nn_ptr,
|
||||
unsigned char *rt_ret,
|
||||
unsigned char *buf_ret
|
||||
);
|
||||
|
||||
uint32_t librustzcash_mmr_delete(
|
||||
uint32_t cbranch,
|
||||
uint32_t t_len,
|
||||
const uint32_t *ni_ptr,
|
||||
const unsigned char *n_ptr,
|
||||
size_t p_len,
|
||||
size_t e_len,
|
||||
unsigned char *rt_ret
|
||||
);
|
||||
|
||||
uint32_t librustzcash_mmr_hash_node(
|
||||
uint32_t cbranch,
|
||||
const unsigned char *n_ptr,
|
||||
unsigned char *h_ret
|
||||
);
|
||||
}
|
||||
|
||||
#endif // LIBRUSTZCASH_INCLUDE_H_
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,225 @@
|
|||
use zcash_history::{Entry, EntryLink, NodeData};
|
||||
|
||||
use crate::{librustzcash_mmr_append, librustzcash_mmr_delete};
|
||||
|
||||
const NODE_DATA_16L: &[u8] = include_bytes!("./res/tree16.dat");
|
||||
const NODE_DATA_1023L: &[u8] = include_bytes!("./res/tree1023.dat");
|
||||
|
||||
struct TreeView {
|
||||
peaks: Vec<(u32, Entry)>,
|
||||
extra: Vec<(u32, Entry)>,
|
||||
}
|
||||
|
||||
fn draft(into: &mut Vec<(u32, Entry)>, nodes: &[NodeData], peak_pos: usize, h: u32) {
|
||||
let node_data = nodes[peak_pos - 1].clone();
|
||||
let peak: Entry = match h {
|
||||
0 => node_data.into(),
|
||||
_ => Entry::new(
|
||||
node_data,
|
||||
EntryLink::Stored((peak_pos - (1 << h) - 1) as u32),
|
||||
EntryLink::Stored((peak_pos - 2) as u32),
|
||||
),
|
||||
};
|
||||
|
||||
into.push(((peak_pos - 1) as u32, peak));
|
||||
}
|
||||
|
||||
fn prepare_tree(nodes: &[NodeData]) -> TreeView {
|
||||
assert!(!nodes.is_empty());
|
||||
|
||||
// integer log2 of (nodes.len()+1), -1
|
||||
let mut h = (32 - ((nodes.len() + 1) as u32).leading_zeros() - 1) - 1;
|
||||
let mut peak_pos = (1 << (h + 1)) - 1;
|
||||
let mut peaks = Vec::new();
|
||||
|
||||
// used later
|
||||
let mut last_peak_pos = 0;
|
||||
let mut last_peak_h = 0;
|
||||
|
||||
loop {
|
||||
if peak_pos > nodes.len() {
|
||||
// left child, -2^h
|
||||
peak_pos -= 1 << h;
|
||||
h -= 1;
|
||||
}
|
||||
|
||||
if peak_pos <= nodes.len() {
|
||||
draft(&mut peaks, nodes, peak_pos, h);
|
||||
|
||||
// save to be used in next loop
|
||||
last_peak_pos = peak_pos;
|
||||
last_peak_h = h;
|
||||
|
||||
// right sibling
|
||||
peak_pos += (1 << (h + 1)) - 1;
|
||||
}
|
||||
|
||||
if h == 0 {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// for deletion, everything on the right slope of the last peak should be pre-loaded
|
||||
let mut extra = Vec::new();
|
||||
let mut h = last_peak_h;
|
||||
let mut peak_pos = last_peak_pos;
|
||||
|
||||
while h > 0 {
|
||||
let left_pos = peak_pos - (1 << h);
|
||||
let right_pos = peak_pos - 1;
|
||||
h -= 1;
|
||||
|
||||
// drafting left child
|
||||
draft(&mut extra, nodes, left_pos, h);
|
||||
|
||||
// drafting right child
|
||||
draft(&mut extra, nodes, right_pos, h);
|
||||
|
||||
// continuing on right slope
|
||||
peak_pos = right_pos;
|
||||
}
|
||||
|
||||
TreeView { peaks, extra }
|
||||
}
|
||||
|
||||
fn preload_tree_append(nodes: &[NodeData]) -> (Vec<u32>, Vec<[u8; zcash_history::MAX_ENTRY_SIZE]>) {
|
||||
assert!(!nodes.is_empty());
|
||||
|
||||
let tree_view = prepare_tree(nodes);
|
||||
|
||||
let mut indices = Vec::new();
|
||||
let mut bytes = Vec::new();
|
||||
|
||||
for (idx, entry) in tree_view.peaks.into_iter() {
|
||||
let mut buf = [0u8; zcash_history::MAX_ENTRY_SIZE];
|
||||
entry
|
||||
.write(&mut &mut buf[..])
|
||||
.expect("Cannot fail if enough buffer length");
|
||||
indices.push(idx);
|
||||
bytes.push(buf);
|
||||
}
|
||||
|
||||
(indices, bytes)
|
||||
}
|
||||
|
||||
// also returns number of peaks
|
||||
fn preload_tree_delete(
|
||||
nodes: &[NodeData],
|
||||
) -> (Vec<u32>, Vec<[u8; zcash_history::MAX_ENTRY_SIZE]>, usize) {
|
||||
assert!(!nodes.is_empty());
|
||||
|
||||
let tree_view = prepare_tree(nodes);
|
||||
|
||||
let mut indices = Vec::new();
|
||||
let mut bytes = Vec::new();
|
||||
|
||||
let peak_count = tree_view.peaks.len();
|
||||
|
||||
for (idx, entry) in tree_view
|
||||
.peaks
|
||||
.into_iter()
|
||||
.chain(tree_view.extra.into_iter())
|
||||
{
|
||||
let mut buf = [0u8; zcash_history::MAX_ENTRY_SIZE];
|
||||
entry
|
||||
.write(&mut &mut buf[..])
|
||||
.expect("Cannot fail if enough buffer length");
|
||||
indices.push(idx);
|
||||
bytes.push(buf);
|
||||
}
|
||||
|
||||
(indices, bytes, peak_count)
|
||||
}
|
||||
|
||||
fn load_nodes(bytes: &'static [u8]) -> Vec<NodeData> {
|
||||
let mut res = Vec::new();
|
||||
let mut cursor = std::io::Cursor::new(bytes);
|
||||
while (cursor.position() as usize) < bytes.len() {
|
||||
let node_data = zcash_history::NodeData::read(0, &mut cursor)
|
||||
.expect("Statically checked to be correct");
|
||||
res.push(node_data);
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn append() {
|
||||
let nodes = load_nodes(NODE_DATA_16L);
|
||||
let (indices, peaks) = preload_tree_append(&nodes);
|
||||
|
||||
let mut rt_ret = [0u8; 32];
|
||||
|
||||
let mut buf_ret = Vec::<[u8; zcash_history::MAX_NODE_DATA_SIZE]>::with_capacity(32);
|
||||
|
||||
let mut new_node_data = [0u8; zcash_history::MAX_NODE_DATA_SIZE];
|
||||
let new_node = NodeData {
|
||||
consensus_branch_id: 0,
|
||||
subtree_commitment: [0u8; 32],
|
||||
start_time: 101,
|
||||
end_time: 110,
|
||||
start_target: 190,
|
||||
end_target: 200,
|
||||
start_sapling_root: [0u8; 32],
|
||||
end_sapling_root: [0u8; 32],
|
||||
subtree_total_work: Default::default(),
|
||||
start_height: 10,
|
||||
end_height: 10,
|
||||
sapling_tx: 13,
|
||||
};
|
||||
new_node
|
||||
.write(&mut &mut new_node_data[..])
|
||||
.expect("Failed to write node data");
|
||||
|
||||
let result = librustzcash_mmr_append(
|
||||
0,
|
||||
nodes.len() as u32,
|
||||
indices.as_ptr(),
|
||||
peaks.as_ptr(),
|
||||
peaks.len(),
|
||||
&new_node_data,
|
||||
&mut rt_ret,
|
||||
buf_ret.as_mut_ptr(),
|
||||
);
|
||||
|
||||
unsafe {
|
||||
buf_ret.set_len(result as usize);
|
||||
}
|
||||
|
||||
assert_eq!(result, 2);
|
||||
|
||||
let new_node_1 =
|
||||
NodeData::from_bytes(0, &buf_ret[0][..]).expect("Failed to reconstruct return node #1");
|
||||
|
||||
let new_node_2 =
|
||||
NodeData::from_bytes(0, &buf_ret[1][..]).expect("Failed to reconstruct return node #2");
|
||||
|
||||
assert_eq!(new_node_1.start_height, 10);
|
||||
assert_eq!(new_node_1.end_height, 10);
|
||||
|
||||
// this is combined new node (which is `new_node_1`) + the one which was there before (for block #9)
|
||||
assert_eq!(new_node_2.start_height, 9);
|
||||
assert_eq!(new_node_2.end_height, 10);
|
||||
assert_eq!(new_node_2.sapling_tx, 27);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn delete() {
|
||||
let nodes = load_nodes(NODE_DATA_1023L);
|
||||
let (indices, nodes, peak_count) = preload_tree_delete(&nodes);
|
||||
|
||||
let mut rt_ret = [0u8; 32];
|
||||
|
||||
let result = librustzcash_mmr_delete(
|
||||
0,
|
||||
nodes.len() as u32,
|
||||
indices.as_ptr(),
|
||||
nodes.as_ptr(),
|
||||
peak_count,
|
||||
indices.len() - peak_count,
|
||||
&mut rt_ret,
|
||||
);
|
||||
|
||||
// Deleting from full tree of 9 height would result in cascade deleting of 10 nodes
|
||||
assert_eq!(result, 10);
|
||||
}
|
|
@ -4,6 +4,7 @@ use super::JUBJUB;
|
|||
|
||||
mod key_agreement;
|
||||
mod key_components;
|
||||
mod mmr;
|
||||
mod notes;
|
||||
mod signatures;
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue