1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

fix m1 build

This commit is contained in:
dark64 2021-12-16 15:48:23 +01:00
parent 144288e47b
commit 610d36b6a9
4 changed files with 45 additions and 52 deletions

87
Cargo.lock generated
View file

@ -483,6 +483,15 @@ dependencies = [
"generic-array 0.14.4",
]
[[package]]
name = "block-buffer"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
dependencies = [
"generic-array 0.14.4",
]
[[package]]
name = "block-padding"
version = "0.1.5"
@ -709,6 +718,15 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "crypto-common"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
dependencies = [
"generic-array 0.14.4",
]
[[package]]
name = "crypto-mac"
version = "0.7.0"
@ -802,6 +820,17 @@ dependencies = [
"generic-array 0.14.4",
]
[[package]]
name = "digest"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
dependencies = [
"block-buffer 0.10.0",
"crypto-common",
"generic-array 0.14.4",
]
[[package]]
name = "dirs"
version = "3.0.2"
@ -1041,12 +1070,6 @@ dependencies = [
"slab",
]
[[package]]
name = "gcc"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
[[package]]
name = "generic-array"
version = "0.12.4"
@ -1629,16 +1652,6 @@ dependencies = [
"proc-macro2 1.0.30",
]
[[package]]
name = "rand"
version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
dependencies = [
"libc",
"rand 0.4.6",
]
[[package]]
name = "rand"
version = "0.4.6"
@ -1845,31 +1858,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "rust-crypto"
version = "0.2.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
dependencies = [
"gcc",
"libc",
"rand 0.3.23",
"rustc-serialize",
"time",
]
[[package]]
name = "rustc-demangle"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
[[package]]
name = "rustc-serialize"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
[[package]]
name = "rustc_version"
version = "0.3.3"
@ -2020,6 +2014,17 @@ dependencies = [
"opaque-debug 0.3.0",
]
[[package]]
name = "sha2"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "900d964dd36bb15bcf2f2b35694c072feab74969a54f2bbeec7a2d725d2bdcb6"
dependencies = [
"cfg-if 1.0.0",
"cpufeatures",
"digest 0.10.1",
]
[[package]]
name = "single"
version = "1.0.0"
@ -2153,16 +2158,6 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "time"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "tiny-keccak"
version = "2.0.2"
@ -2528,10 +2523,10 @@ dependencies = [
"log",
"rand 0.4.6",
"regex 0.2.11",
"rust-crypto",
"serde",
"serde_cbor",
"serde_json",
"sha2 0.10.0",
"tempdir",
"typed-arena",
"zokrates_abi",

View file

@ -0,0 +1 @@
Fix building issue with `aarch64-apple-darwin` target (M1)

View file

@ -28,10 +28,10 @@ serde = { version = "1.0", features = ["derive"] }
dirs = "3.0.1"
lazy_static = "1.4.0"
byteorder = "1"
rust-crypto = "0.2.36"
rand = "0.4"
hex = "0.3.1"
blake2 = "0.8.1"
sha2 = "0.10.0"
[dev-dependencies]
glob = "0.2.11"

View file

@ -87,10 +87,9 @@ fn cli_mpc_beacon<T: Field + BellmanFieldExtensions, S: MpcScheme<T>, B: MpcBack
// Create an RNG based on the outcome of the random beacon
let mut rng = {
use byteorder::{BigEndian, ReadBytesExt};
use crypto::digest::Digest;
use crypto::sha2::Sha256;
use rand::chacha::ChaChaRng;
use rand::SeedableRng;
use sha2::{Digest, Sha256};
// The hash used for the beacon
let mut cur_hash = hex::decode(beacon_hash)
@ -115,9 +114,7 @@ fn cli_mpc_beacon<T: Field + BellmanFieldExtensions, S: MpcScheme<T>, B: MpcBack
println!();
}
let mut h = Sha256::new();
h.input(&cur_hash);
h.result(&mut cur_hash);
cur_hash = Sha256::digest(&cur_hash).to_vec();
}
print!("Final result of beacon: ");