rust: zcash_{primitives, proofs} 0.5.0

This commit is contained in:
Jack Grigg 2021-03-27 10:42:35 +13:00
parent 5ffcb198a7
commit 8393b3da88
5 changed files with 41 additions and 42 deletions

56
Cargo.lock generated
View File

@ -2,33 +2,32 @@
# It is not intended for manual editing.
[[package]]
name = "aes"
version = "0.5.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd2bc6d3f370b5666245ff421e231cba4353df936e26986d2918e61a8fd6aef6"
checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561"
dependencies = [
"aes-soft",
"aesni",
"block-cipher",
"cipher",
]
[[package]]
name = "aes-soft"
version = "0.5.0"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6"
checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072"
dependencies = [
"block-cipher",
"byteorder",
"cipher",
"opaque-debug",
]
[[package]]
name = "aesni"
version = "0.8.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6fe808308bb07d393e2ea47780043ec47683fcf19cf5efc8ca51c50cc8c68a"
checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce"
dependencies = [
"block-cipher",
"cipher",
"opaque-debug",
]
@ -137,23 +136,14 @@ dependencies = [
"generic-array",
]
[[package]]
name = "block-cipher"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80"
dependencies = [
"generic-array",
]
[[package]]
name = "block-modes"
version = "0.6.1"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c9b14fd8a4739e6548d4b6018696cf991dcf8c6effd9ef9eb33b29b8a650972"
checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0"
dependencies = [
"block-cipher",
"block-padding",
"cipher",
]
[[package]]
@ -207,6 +197,15 @@ dependencies = [
"winapi",
]
[[package]]
name = "cipher"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801"
dependencies = [
"generic-array",
]
[[package]]
name = "constant_time_eq"
version = "0.1.5"
@ -412,9 +411,9 @@ dependencies = [
[[package]]
name = "fpe"
version = "0.3.1"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef2196a22f6d98bbde79ae510eb4f397bd446cfbd6c26425e25ec81442a31bab"
checksum = "a25080721bbcd2cd4d765b7d607ea350425fa087ce53cd3e31afcacdab850352"
dependencies = [
"aes",
"block-modes",
@ -1005,9 +1004,9 @@ dependencies = [
[[package]]
name = "zcash_primitives"
version = "0.4.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45ab71b5765cb89a423e3a2f0de596dc8e581bf5bbf9d933bc8c22833886d13c"
checksum = "926666fae42e08d65ddba7c3808873d1e6cd6e7dd86e84f51a909c79b5fe285c"
dependencies = [
"aes",
"bitvec",
@ -1019,6 +1018,7 @@ dependencies = [
"equihash",
"ff",
"fpe",
"funty",
"group",
"hex",
"jubjub",
@ -1032,9 +1032,9 @@ dependencies = [
[[package]]
name = "zcash_proofs"
version = "0.4.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "902845afb8636c4f88c0fd2a8bf338b645474488cb60676194fbf7713a3b9cc0"
checksum = "bc3cd16a4efbebf925756f339d01e876816d37d1f458bd8243edb3bd8dbad74b"
dependencies = [
"bellman",
"blake2b_simd",

View File

@ -33,8 +33,8 @@ tracing = "0.1"
tracing-core = "0.1"
tracing-appender = "0.1"
zcash_history = "0.2"
zcash_primitives = "0.4"
zcash_proofs = "0.4"
zcash_primitives = "0.5"
zcash_proofs = "0.5"
ed25519-zebra = "2.0.0"
# Temporary workaround for https://github.com/myrrlyn/funty/issues/3

View File

@ -145,19 +145,18 @@ pub extern "C" fn librustzcash_init_zksnark_params(
);
// Load params
let (spend_params, spend_vk, output_params, output_vk, sprout_vk) =
load_parameters(spend_path, output_path, sprout_path);
let params = load_parameters(spend_path, output_path, sprout_path);
// Caller is responsible for calling this function once, so
// these global mutations are safe.
unsafe {
SAPLING_SPEND_PARAMS = Some(spend_params);
SAPLING_OUTPUT_PARAMS = Some(output_params);
SAPLING_SPEND_PARAMS = Some(params.spend_params);
SAPLING_OUTPUT_PARAMS = Some(params.output_params);
SPROUT_GROTH16_PARAMS_PATH = sprout_path.map(|p| p.to_owned());
SAPLING_SPEND_VK = Some(spend_vk);
SAPLING_OUTPUT_VK = Some(output_vk);
SPROUT_GROTH16_VK = sprout_vk;
SAPLING_SPEND_VK = Some(params.spend_vk);
SAPLING_OUTPUT_VK = Some(params.output_vk);
SPROUT_GROTH16_VK = params.sprout_vk;
}
}
@ -386,7 +385,7 @@ pub extern "C" fn librustzcash_sapling_compute_nf(
let vk = ViewingKey { ak, nk };
let nf = note.nf(&vk, position);
let result = unsafe { &mut *result };
result.copy_from_slice(&nf);
result.copy_from_slice(&nf.0);
true
}

View File

@ -29,7 +29,7 @@ fn test_key_agreement() {
// Grab ivk from our viewing key in serialized form
let ivk = vk.ivk();
let ivk_serialized = ivk.to_bytes();
let ivk_serialized = ivk.to_repr();
// Create random esk
let mut esk = [0u8; 32];

View File

@ -1,7 +1,7 @@
use group::GroupEncoding;
use zcash_primitives::{
constants::SPENDING_KEY_GENERATOR,
primitives::{Diversifier, ProofGenerationKey, Rseed},
primitives::{Diversifier, Nullifier, ProofGenerationKey, Rseed},
};
use crate::{
@ -674,7 +674,7 @@ fn key_components() {
assert_eq!(&nk, &tv.nk);
}
assert_eq!(&fvk.ivk().to_bytes(), &tv.ivk);
assert_eq!(&fvk.ivk().to_repr(), &tv.ivk);
{
let mut ivk = [0u8; 32];
librustzcash_crh_ivk(&tv.ak, &tv.nk, &mut ivk);
@ -698,6 +698,6 @@ fn key_components() {
.unwrap();
assert_eq!(&note.cmu().to_bytes(), &tv.note_cm);
assert_eq!(note.nf(&fvk, tv.note_pos), tv.note_nf);
assert_eq!(note.nf(&fvk, tv.note_pos), Nullifier(tv.note_nf));
}
}