mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-14 10:45:47 +00:00
Move redjubjub into zcash_primitives
This commit is contained in:
parent
f931562431
commit
7ea6d10480
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -552,6 +552,7 @@ dependencies = [
|
||||
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_os 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sapling-crypto 0.0.1",
|
||||
"sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -24,7 +24,6 @@ use sapling_crypto::{
|
||||
fs::{Fs, FsRepr},
|
||||
FixedGenerators, JubjubEngine, JubjubParams, PrimeOrder, ToUniform, Unknown,
|
||||
},
|
||||
redjubjub::{self, Signature},
|
||||
};
|
||||
|
||||
use sapling_crypto::circuit::sapling::TREE_DEPTH as SAPLING_TREE_DEPTH;
|
||||
@ -62,6 +61,7 @@ use sapling_crypto::primitives::{ProofGenerationKey, ViewingKey};
|
||||
use zcash_primitives::{
|
||||
merkle_tree::CommitmentTreeWitness,
|
||||
note_encryption::sapling_ka_agree,
|
||||
redjubjub::{self, Signature},
|
||||
sapling::{merkle_hash, spend_sig},
|
||||
transaction::components::Amount,
|
||||
zip32, JUBJUB,
|
||||
|
@ -1,9 +1,7 @@
|
||||
use ff::{PrimeField, PrimeFieldRepr};
|
||||
use pairing::bls12_381::Bls12;
|
||||
use sapling_crypto::{
|
||||
jubjub::{FixedGenerators, JubjubEngine},
|
||||
redjubjub::{PrivateKey, PublicKey, Signature},
|
||||
};
|
||||
use sapling_crypto::jubjub::{FixedGenerators, JubjubEngine};
|
||||
use zcash_primitives::redjubjub::{PrivateKey, PublicKey, Signature};
|
||||
|
||||
use super::JUBJUB;
|
||||
|
||||
|
@ -23,5 +23,3 @@ pub mod circuit;
|
||||
pub mod pedersen_hash;
|
||||
pub mod primitives;
|
||||
pub mod constants;
|
||||
pub mod redjubjub;
|
||||
pub mod util;
|
||||
|
@ -20,3 +20,6 @@ rand_core = "0.5"
|
||||
rand_os = "0.2"
|
||||
sapling-crypto = { path = "../sapling-crypto" }
|
||||
sha2 = "0.8"
|
||||
|
||||
[dev-dependencies]
|
||||
rand_xorshift = "0.2"
|
||||
|
@ -15,6 +15,9 @@ extern crate rand_os;
|
||||
extern crate sapling_crypto;
|
||||
extern crate sha2;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate rand_xorshift;
|
||||
|
||||
use sapling_crypto::jubjub::JubjubBls12;
|
||||
|
||||
pub mod block;
|
||||
@ -23,9 +26,11 @@ pub mod legacy;
|
||||
pub mod merkle_tree;
|
||||
pub mod note_encryption;
|
||||
pub mod prover;
|
||||
pub mod redjubjub;
|
||||
pub mod sapling;
|
||||
mod serialize;
|
||||
pub mod transaction;
|
||||
mod util;
|
||||
pub mod zip32;
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -4,11 +4,11 @@ use pairing::bls12_381::{Bls12, Fr};
|
||||
use sapling_crypto::{
|
||||
jubjub::{edwards, fs::Fs, Unknown},
|
||||
primitives::{Diversifier, PaymentAddress, ProofGenerationKey},
|
||||
redjubjub::{PublicKey, Signature},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
merkle_tree::CommitmentTreeWitness,
|
||||
redjubjub::{PublicKey, Signature},
|
||||
sapling::Node,
|
||||
transaction::components::{Amount, GROTH_PROOF_SIZE},
|
||||
};
|
||||
@ -78,11 +78,11 @@ pub(crate) mod mock {
|
||||
use sapling_crypto::{
|
||||
jubjub::{edwards, fs::Fs, FixedGenerators, Unknown},
|
||||
primitives::{Diversifier, PaymentAddress, ProofGenerationKey, ValueCommitment},
|
||||
redjubjub::{PublicKey, Signature},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
merkle_tree::CommitmentTreeWitness,
|
||||
redjubjub::{PublicKey, Signature},
|
||||
sapling::Node,
|
||||
transaction::components::{Amount, GROTH_PROOF_SIZE},
|
||||
JUBJUB,
|
||||
|
@ -3,10 +3,12 @@
|
||||
|
||||
use ff::{Field, PrimeField, PrimeFieldRepr};
|
||||
use rand_core::RngCore;
|
||||
use sapling_crypto::jubjub::{
|
||||
edwards::Point, FixedGenerators, JubjubEngine, JubjubParams, Unknown,
|
||||
};
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
use jubjub::{FixedGenerators, JubjubEngine, JubjubParams, Unknown, edwards::Point};
|
||||
use util::{hash_to_scalar};
|
||||
use util::hash_to_scalar;
|
||||
|
||||
fn read_scalar<E: JubjubEngine, R: Read>(reader: R) -> io::Result<E::Fs> {
|
||||
let mut s_repr = <E::Fs as PrimeField>::Repr::default();
|
||||
@ -208,8 +210,7 @@ mod tests {
|
||||
use pairing::bls12_381::Bls12;
|
||||
use rand_core::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
|
||||
use jubjub::{JubjubBls12, fs::Fs, edwards};
|
||||
use sapling_crypto::jubjub::{edwards, fs::Fs, JubjubBls12};
|
||||
|
||||
use super::*;
|
||||
|
@ -7,11 +7,11 @@ use sapling_crypto::{
|
||||
jubjub::{fs::Fs, FixedGenerators, JubjubBls12},
|
||||
pedersen_hash::{pedersen_hash, Personalization},
|
||||
primitives::Note,
|
||||
redjubjub::{PrivateKey, PublicKey, Signature},
|
||||
};
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
use crate::merkle_tree::Hashable;
|
||||
use crate::redjubjub::{PrivateKey, PublicKey, Signature};
|
||||
use JUBJUB;
|
||||
|
||||
pub(crate) const SAPLING_COMMITMENT_TREE_DEPTH: usize =
|
||||
|
@ -6,7 +6,6 @@ use rand::{rngs::OsRng, seq::SliceRandom, CryptoRng, RngCore};
|
||||
use sapling_crypto::{
|
||||
jubjub::fs::Fs,
|
||||
primitives::{Diversifier, Note, PaymentAddress},
|
||||
redjubjub::PrivateKey,
|
||||
};
|
||||
use zip32::ExtendedSpendingKey;
|
||||
|
||||
@ -16,6 +15,7 @@ use crate::{
|
||||
merkle_tree::{CommitmentTreeWitness, IncrementalWitness},
|
||||
note_encryption::{generate_esk, Memo, SaplingNoteEncryption},
|
||||
prover::TxProver,
|
||||
redjubjub::PrivateKey,
|
||||
sapling::{spend_sig, Node},
|
||||
transaction::{
|
||||
components::{amount::DEFAULT_FEE, Amount, OutputDescription, SpendDescription, TxOut},
|
||||
|
@ -1,13 +1,11 @@
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use ff::{PrimeField, PrimeFieldRepr};
|
||||
use pairing::bls12_381::{Bls12, Fr, FrRepr};
|
||||
use sapling_crypto::{
|
||||
jubjub::{edwards, Unknown},
|
||||
redjubjub::{PublicKey, Signature},
|
||||
};
|
||||
use sapling_crypto::jubjub::{edwards, Unknown};
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
use legacy::Script;
|
||||
use redjubjub::{PublicKey, Signature};
|
||||
use JUBJUB;
|
||||
|
||||
pub mod amount;
|
||||
|
@ -1,11 +1,11 @@
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use hex;
|
||||
use sapling_crypto::redjubjub::Signature;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::fmt;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::ops::Deref;
|
||||
|
||||
use redjubjub::Signature;
|
||||
use serialize::Vector;
|
||||
|
||||
pub mod builder;
|
||||
|
@ -1,13 +1,11 @@
|
||||
use ff::Field;
|
||||
use pairing::bls12_381::Bls12;
|
||||
use rand_os::OsRng;
|
||||
use sapling_crypto::{
|
||||
jubjub::{fs::Fs, FixedGenerators},
|
||||
redjubjub::PrivateKey,
|
||||
};
|
||||
use sapling_crypto::jubjub::{fs::Fs, FixedGenerators};
|
||||
|
||||
use super::{components::Amount, sighash::signature_hash, Transaction, TransactionData};
|
||||
use legacy::Script;
|
||||
use redjubjub::PrivateKey;
|
||||
use JUBJUB;
|
||||
|
||||
#[test]
|
||||
|
@ -1,6 +1,5 @@
|
||||
use blake2b_simd::Params;
|
||||
|
||||
use jubjub::{JubjubEngine, ToUniform};
|
||||
use sapling_crypto::jubjub::{JubjubEngine, ToUniform};
|
||||
|
||||
pub fn hash_to_scalar<E: JubjubEngine>(persona: &[u8], a: &[u8], b: &[u8]) -> E::Fs {
|
||||
let mut hasher = Params::new().hash_length(64).personal(persona).to_state();
|
@ -6,12 +6,12 @@ use pairing::bls12_381::{Bls12, Fr};
|
||||
use sapling_crypto::{
|
||||
jubjub::{edwards, fs::Fs, Unknown},
|
||||
primitives::{Diversifier, PaymentAddress, ProofGenerationKey},
|
||||
redjubjub::{PublicKey, Signature},
|
||||
};
|
||||
use std::path::Path;
|
||||
use zcash_primitives::{
|
||||
merkle_tree::CommitmentTreeWitness,
|
||||
prover::TxProver,
|
||||
redjubjub::{PublicKey, Signature},
|
||||
sapling::Node,
|
||||
transaction::components::{Amount, GROTH_PROOF_SIZE},
|
||||
JUBJUB,
|
||||
|
@ -11,10 +11,12 @@ use sapling_crypto::{
|
||||
},
|
||||
jubjub::{edwards, fs::Fs, FixedGenerators, JubjubBls12, Unknown},
|
||||
primitives::{Diversifier, Note, PaymentAddress, ProofGenerationKey, ValueCommitment},
|
||||
redjubjub::{PrivateKey, PublicKey, Signature},
|
||||
};
|
||||
use zcash_primitives::{
|
||||
merkle_tree::CommitmentTreeWitness, sapling::Node, transaction::components::Amount,
|
||||
merkle_tree::CommitmentTreeWitness,
|
||||
redjubjub::{PrivateKey, PublicKey, Signature},
|
||||
sapling::Node,
|
||||
transaction::components::Amount,
|
||||
};
|
||||
|
||||
use super::compute_value_balance;
|
||||
|
@ -4,9 +4,11 @@ use pairing::bls12_381::{Bls12, Fr};
|
||||
use sapling_crypto::{
|
||||
circuit::multipack,
|
||||
jubjub::{edwards, FixedGenerators, JubjubBls12, Unknown},
|
||||
redjubjub::{PublicKey, Signature},
|
||||
};
|
||||
use zcash_primitives::transaction::components::Amount;
|
||||
use zcash_primitives::{
|
||||
redjubjub::{PublicKey, Signature},
|
||||
transaction::components::Amount,
|
||||
};
|
||||
|
||||
use super::compute_value_balance;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user