cl: drop blake2; print prover time

This commit is contained in:
David Rusu 2024-07-05 06:38:56 +00:00
parent bf25df4c6e
commit b0cb075f58
3 changed files with 9 additions and 4 deletions

View File

@ -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::<Blake2b512>(bytes)
RistrettoPoint::hash_from_bytes::<Sha512>(bytes)
}

View File

@ -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

View File

@ -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;