mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-31 12:31:22 +00:00
Make zcash_primitives::JUBJUB the canonical instantiation of JubjubBls12
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -466,9 +466,9 @@ dependencies = [
|
|||||||
"byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ff 0.4.0",
|
"ff 0.4.0",
|
||||||
"fpe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fpe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"pairing 0.14.2",
|
"pairing 0.14.2",
|
||||||
"sapling-crypto 0.0.1",
|
"sapling-crypto 0.0.1",
|
||||||
|
"zcash_primitives 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
|
@@ -12,7 +12,6 @@ extern crate zip32;
|
|||||||
|
|
||||||
mod hashreader;
|
mod hashreader;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
use ff::{BitIterator, PrimeField, PrimeFieldRepr};
|
use ff::{BitIterator, PrimeField, PrimeFieldRepr};
|
||||||
@@ -24,7 +23,7 @@ use sapling_crypto::{
|
|||||||
jubjub::{
|
jubjub::{
|
||||||
edwards,
|
edwards,
|
||||||
fs::{Fs, FsRepr},
|
fs::{Fs, FsRepr},
|
||||||
FixedGenerators, JubjubBls12, JubjubEngine, JubjubParams, PrimeOrder, ToUniform, Unknown,
|
FixedGenerators, JubjubEngine, JubjubParams, PrimeOrder, ToUniform, Unknown,
|
||||||
},
|
},
|
||||||
pedersen_hash::{pedersen_hash, Personalization},
|
pedersen_hash::{pedersen_hash, Personalization},
|
||||||
redjubjub::{self, Signature},
|
redjubjub::{self, Signature},
|
||||||
@@ -62,7 +61,7 @@ use std::ffi::OsString;
|
|||||||
use std::os::windows::ffi::OsStringExt;
|
use std::os::windows::ffi::OsStringExt;
|
||||||
|
|
||||||
use sapling_crypto::primitives::{ProofGenerationKey, ViewingKey};
|
use sapling_crypto::primitives::{ProofGenerationKey, ViewingKey};
|
||||||
use zcash_primitives::sapling::spend_sig;
|
use zcash_primitives::{sapling::spend_sig, JUBJUB};
|
||||||
use zcash_proofs::sapling::{
|
use zcash_proofs::sapling::{
|
||||||
CommitmentTreeWitness, SaplingProvingContext, SaplingVerificationContext,
|
CommitmentTreeWitness, SaplingProvingContext, SaplingVerificationContext,
|
||||||
};
|
};
|
||||||
@@ -72,10 +71,6 @@ pub mod equihash;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
lazy_static! {
|
|
||||||
static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };
|
|
||||||
}
|
|
||||||
|
|
||||||
static mut SAPLING_SPEND_VK: Option<PreparedVerifyingKey<Bls12>> = None;
|
static mut SAPLING_SPEND_VK: Option<PreparedVerifyingKey<Bls12>> = None;
|
||||||
static mut SAPLING_OUTPUT_VK: Option<PreparedVerifyingKey<Bls12>> = None;
|
static mut SAPLING_OUTPUT_VK: Option<PreparedVerifyingKey<Bls12>> = None;
|
||||||
static mut SPROUT_GROTH16_VK: Option<PreparedVerifyingKey<Bls12>> = None;
|
static mut SPROUT_GROTH16_VK: Option<PreparedVerifyingKey<Bls12>> = None;
|
||||||
|
@@ -15,5 +15,5 @@ mod serialize;
|
|||||||
pub mod transaction;
|
pub mod transaction;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };
|
pub static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };
|
||||||
}
|
}
|
||||||
|
@@ -16,9 +16,9 @@ aes = "0.2"
|
|||||||
byteorder = "1"
|
byteorder = "1"
|
||||||
ff = { path = "../ff" }
|
ff = { path = "../ff" }
|
||||||
fpe = "0.1"
|
fpe = "0.1"
|
||||||
lazy_static = "1.0"
|
|
||||||
pairing = { path = "../pairing" }
|
pairing = { path = "../pairing" }
|
||||||
sapling-crypto = { path = "../sapling-crypto" }
|
sapling-crypto = { path = "../sapling-crypto" }
|
||||||
|
zcash_primitives = { path = "../zcash_primitives" }
|
||||||
|
|
||||||
[dependencies.blake2-rfc]
|
[dependencies.blake2-rfc]
|
||||||
git = "https://github.com/gtank/blake2-rfc"
|
git = "https://github.com/gtank/blake2-rfc"
|
||||||
|
@@ -3,10 +3,9 @@ extern crate blake2_rfc;
|
|||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate ff;
|
extern crate ff;
|
||||||
extern crate fpe;
|
extern crate fpe;
|
||||||
#[macro_use]
|
|
||||||
extern crate lazy_static;
|
|
||||||
extern crate pairing;
|
extern crate pairing;
|
||||||
extern crate sapling_crypto;
|
extern crate sapling_crypto;
|
||||||
|
extern crate zcash_primitives;
|
||||||
|
|
||||||
use aes::Aes256;
|
use aes::Aes256;
|
||||||
use blake2_rfc::blake2b::{Blake2b, Blake2bResult};
|
use blake2_rfc::blake2b::{Blake2b, Blake2bResult};
|
||||||
@@ -15,16 +14,11 @@ use ff::{Field, PrimeField, PrimeFieldRepr};
|
|||||||
use fpe::ff1::{BinaryNumeralString, FF1};
|
use fpe::ff1::{BinaryNumeralString, FF1};
|
||||||
use pairing::bls12_381::Bls12;
|
use pairing::bls12_381::Bls12;
|
||||||
use sapling_crypto::{
|
use sapling_crypto::{
|
||||||
jubjub::{
|
jubjub::{edwards, FixedGenerators, JubjubEngine, JubjubParams, ToUniform, Unknown},
|
||||||
edwards, FixedGenerators, JubjubBls12, JubjubEngine, JubjubParams, ToUniform, Unknown,
|
|
||||||
},
|
|
||||||
primitives::{Diversifier, PaymentAddress, ViewingKey},
|
primitives::{Diversifier, PaymentAddress, ViewingKey},
|
||||||
};
|
};
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
|
use zcash_primitives::JUBJUB;
|
||||||
lazy_static! {
|
|
||||||
static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const PRF_EXPAND_PERSONALIZATION: &'static [u8; 16] = b"Zcash_ExpandSeed";
|
pub const PRF_EXPAND_PERSONALIZATION: &'static [u8; 16] = b"Zcash_ExpandSeed";
|
||||||
pub const ZIP32_SAPLING_MASTER_PERSONALIZATION: &'static [u8; 16] = b"ZcashIP32Sapling";
|
pub const ZIP32_SAPLING_MASTER_PERSONALIZATION: &'static [u8; 16] = b"ZcashIP32Sapling";
|
||||||
|
Reference in New Issue
Block a user