Skip to content

Commit

Permalink
updated some dependencies to match the versions used by snarkVM
Browse files Browse the repository at this point in the history
  • Loading branch information
ibaryshnikov committed Aug 11, 2021
1 parent 59921e5 commit 0465f0c
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 249 deletions.
372 changes: 152 additions & 220 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion phase1-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tracing-subscriber = { version = "0.2.3" }
wasm-bindgen-test = { version = "0.3.18" }

[build-dependencies]
rustc_version = { version = "0.3" }
rustc_version = "0.4.0"

[features]
default = ["cli"]
Expand Down
4 changes: 2 additions & 2 deletions phase1-coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ snarkvm-curves = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c"
anyhow = { version = "1.0.37" }
chrono = { version = "0.4", features = ["serde"] }
chrono-humanize = { version = "0.2" }
itertools = { version = "0.9.0" }
itertools = "0.10"
futures = { version = "0.3" }
hex = { version = "0.4.2" }
memmap = { version = "0.7.0" }
Expand All @@ -33,7 +33,7 @@ serde-diff = { version = "0.4" }
serde_json = { version = "1.0" }
serde_with = { version = "1.8", features = ["chrono", "macros"] }
thiserror = { version = "1.0" }
tokio = { version = "1.8", features = ["macros", "rt-multi-thread", "time", "sync", "signal"] }
tokio = { version = "1.9", features = ["macros", "rt-multi-thread", "time", "sync", "signal"] }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.2" }

Expand Down
5 changes: 2 additions & 3 deletions phase1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ snarkvm-curves = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c"
snarkvm-fields = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }
snarkvm-utilities = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }

cfg-if = { version = "0.1.10" }
cfg-if = "1.0"
criterion = { version = "0.3", optional = true }
derivative = { version = "2", features = [ "use_core" ] }
itertools = { version = "0.9.0" }
itertools = "0.10"
rand = { version = "0.8" }
rayon = { version = "1.4.1", optional = true }
tracing = { version = "0.1.21" }
Expand Down Expand Up @@ -55,4 +55,3 @@ testing = ["parallel"]
name = "marlin"
path = "tests/marlin.rs"
required-features = ["phase1/testing", "cli"]

4 changes: 2 additions & 2 deletions phase2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ snarkvm-r1cs = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }
snarkvm-utilities = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }

byteorder = { version = "1.3.4" }
cfg-if = { version = "0.1.10" }
cfg-if = "1.0"
crossbeam = { version = "0.8" }
itertools = { version = "0.9.0", optional = true }
itertools = { version = "0.10", optional = true }
num_cpus = { version = "1" }
rand = { version = "0.8" }
rayon = { version = "1.4.1", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions setup-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ snarkvm-fields = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c"
snarkvm-r1cs = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }
snarkvm-utilities = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }

blake2 = { version = "0.8.1" }
blake2 = "0.9"
blake2s_simd = { version = "0.5.11" }
cfg-if = { version = "0.1.10" }
cfg-if = "1.0"
crossbeam = { version = "0.8.0" }
num_cpus = { version = "1.12.0" }
rand = { version = "0.8" }
Expand Down
28 changes: 14 additions & 14 deletions setup-utils/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn user_system_randomness() -> Vec<u8> {
// Gather 1024 bytes of entropy from the system
for _ in 0..1024 {
let r: u8 = system_rng.gen();
h.input(&[r]);
h.update(&[r]);
}

// Ask the user to provide some information for additional entropy
Expand All @@ -116,8 +116,8 @@ pub fn user_system_randomness() -> Vec<u8> {
.expect("expected to read some random text from the user");

// Hash it all up to make a seed
h.input(&user_input.as_bytes());
let arr: GenericArray<u8, U64> = h.result();
h.update(&user_input.as_bytes());
let arr: GenericArray<u8, U64> = h.finalize();
arr.to_vec()
}

Expand Down Expand Up @@ -196,7 +196,7 @@ impl<W: Write> HashWriter<W> {

/// Destroy this writer and return the hash of what was written.
pub fn into_hash(self) -> GenericArray<u8, U64> {
self.hasher.result()
self.hasher.finalize()
}
}

Expand All @@ -205,7 +205,7 @@ impl<W: Write> Write for HashWriter<W> {
let bytes = self.writer.write(buf)?;

if bytes > 0 {
self.hasher.input(&buf[0..bytes]);
self.hasher.update(&buf[0..bytes]);
}

Ok(bytes)
Expand All @@ -224,9 +224,9 @@ pub fn calculate_hash(input_map: &[u8]) -> GenericArray<u8, U64> {
let chunk_size = 1 << 30; // read by 1GB from map
let mut hasher = Blake2b::default();
for chunk in input_map.chunks(chunk_size) {
hasher.input(&chunk);
hasher.update(&chunk);
}
hasher.result()
hasher.finalize()
}

/// Hashes to G2 using the first 32 bytes of `digest`. Panics if `digest` is less
Expand Down Expand Up @@ -348,13 +348,13 @@ pub fn power_pairs<G: AffineCurve>(v: &[G]) -> (G, G) {

/// Compute BLAKE2b("")
pub fn blank_hash() -> GenericArray<u8, U64> {
Blake2b::new().result()
Blake2b::new().finalize()
}

pub fn reduced_hash(old_power: u8, new_power: u8) -> GenericArray<u8, U64> {
let mut hasher = Blake2b::new();
hasher.input(&[old_power, new_power]);
hasher.result()
hasher.update(&[old_power, new_power]);
hasher.finalize()
}

/// Checks if pairs have the same ratio.
Expand Down Expand Up @@ -384,14 +384,14 @@ pub fn compute_g2_s<E: PairingEngine>(
personalization: u8,
) -> Result<E::G2Affine> {
let mut h = Blake2b::default();
h.input(&[personalization]);
h.input(digest);
h.update(&[personalization]);
h.update(digest);
let size = E::G1Affine::SERIALIZED_SIZE;
let mut data = vec![0; 2 * size];
g1_s.serialize(&mut &mut data[..size])?;
g1_s_x.serialize(&mut &mut data[size..])?;
h.input(&data);
Ok(hash_to_g2::<E>(h.result().as_ref()).into_affine())
h.update(&data);
Ok(hash_to_g2::<E>(h.finalize().as_ref()).into_affine())
}

/// Perform multi-exponentiation. The caller is responsible for ensuring that
Expand Down
2 changes: 1 addition & 1 deletion setup1-cli-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/view_key.rs"
snarkvm-dpc = { git = "https://github.com/AleoHQ/snarkVM", rev = "fc997c" }

anyhow = "1.0.38"
age = { version = "0.5.0", features = ["cli-common", "armor"] }
age = { version = "0.6", features = ["cli-common", "armor"] }
hex = "0.4"
rand = "0.8"
secrecy = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion setup1-contributor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ snarkvm-dpc = { git = "https://github.com/AleoHQ/snarkVM", rev = "fc997c" }
snarkvm-curves = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }
snarkvm-utilities = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }

age = { version = "0.5", features = [ "cli-common", "armor" ] }
age = { version = "0.6", features = [ "cli-common", "armor" ] }
anyhow = { version = "1.0.33" }
blake2 = "0.9"
byteorder = { version = "1.3.4", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion setup1-shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ async_message = ["tokio"]
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.7", features = ["io-util"], optional = true }
tokio = { version = "1.9", features = ["io-util"], optional = true }
2 changes: 1 addition & 1 deletion setup1-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ serde_json = { version = "1.0" }
serde_derive = { version = "1.0" }
structopt = "0.3.21"
thiserror = { version = "1.0" }
tokio = { version = "1.7", features = ["macros", "rt-multi-thread", "signal"] }
tokio = { version = "1.9", features = ["macros", "rt-multi-thread", "signal"] }
tracing = { version = "0.1.26" }
tracing-subscriber = { version = "0.2" }
url = "2.2.2"
Expand Down
2 changes: 1 addition & 1 deletion setup2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ snarkvm-r1cs = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }
snarkvm-utilities = { git = "https://github.com/AleoHQ/snarkVM.git", rev = "fc997c" }

anyhow = { version = "1.0.37" }
cfg-if = { version = "0.1.10" }
cfg-if = "1.0"
gumdrop = { version = "0.8.0", optional = true }
hex = { version = "0.4.2" }
hex-literal = { version = "0.3.1", optional = true }
Expand Down

0 comments on commit 0465f0c

Please sign in to comment.