diff --git a/cl/src/crypto.rs b/cl/src/crypto.rs index 8641ff1..e0be5f5 100644 --- a/cl/src/crypto.rs +++ b/cl/src/crypto.rs @@ -1,6 +1,6 @@ -use blake2::Blake2b512; +use sha2::Sha512; use curve25519_dalek::ristretto::RistrettoPoint; pub fn hash_to_curve(bytes: &[u8]) -> RistrettoPoint { - RistrettoPoint::hash_from_bytes::(bytes) + RistrettoPoint::hash_from_bytes::(bytes) } diff --git a/cl/src/note.rs b/cl/src/note.rs index 8dabaea..ea8c8f8 100644 --- a/cl/src/note.rs +++ b/cl/src/note.rs @@ -1,4 +1,4 @@ -use blake2::{Blake2s256, Digest}; +use sha2::{Digest, Sha256}; use rand_core::CryptoRngCore; use serde::{Deserialize, Serialize}; @@ -40,7 +40,7 @@ impl NoteWitness { } pub fn commit(&self, nf_pk: NullifierCommitment, nonce: NullifierNonce) -> NoteCommitment { - let mut hasher = Blake2s256::new(); + let mut hasher = Sha256::new(); hasher.update(b"NOMOS_CL_NOTE_COMMIT"); // COMMIT TO BALANCE diff --git a/goas/host/src/main.rs b/goas/host/src/main.rs index 15d0974..a8347b0 100644 --- a/goas/host/src/main.rs +++ b/goas/host/src/main.rs @@ -78,11 +78,16 @@ fn main() { // Obtain the default prover. let prover = default_prover(); + + use std::time::Instant; + let start_t = Instant::now(); + // Proof information by proving the specified ELF binary. // This struct contains the receipt along with statistics about execution of the guest let opts = risc0_zkvm::ProverOpts::succinct(); let prove_info = prover.prove_with_opts(env, METHOD_ELF, &opts).unwrap(); + println!("STARK prover time: {:.2?}", start_t.elapsed()); // extract the receipt. let receipt = prove_info.receipt;