Skip to content

Commit

Permalink
hack pv digest into keccak
Browse files Browse the repository at this point in the history
  • Loading branch information
noel2004 committed Oct 26, 2024
1 parent 700cdad commit ffd543e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/zkvm/entrypoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ getrandom = { version = "0.2.15", features = ["custom"] }
rand = "0.8.5"
libm = { version = "0.2.8", optional = true }
sha2 = { version = "0.10.8" }
sha3 = { version = "0.10.8" }
lazy_static = "1.5.0"

# optional
Expand Down
6 changes: 3 additions & 3 deletions crates/zkvm/entrypoint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod zkvm {
use crate::syscalls::syscall_halt;

use cfg_if::cfg_if;
use sha2::{Digest, Sha256};
use sha3::{Digest, Keccak256};

cfg_if! {
if #[cfg(feature = "verify")] {
Expand All @@ -36,12 +36,12 @@ mod zkvm {
}
}

pub static mut PUBLIC_VALUES_HASHER: Option<Sha256> = None;
pub static mut PUBLIC_VALUES_HASHER: Option<Keccak256> = None;

#[no_mangle]
unsafe extern "C" fn __start() {
{
PUBLIC_VALUES_HASHER = Some(Sha256::new());
PUBLIC_VALUES_HASHER = Some(Keccak256::new());
#[cfg(feature = "verify")]
{
DEFERRED_PROOFS_DIGEST = Some([BabyBear::zero(); 8]);
Expand Down

0 comments on commit ffd543e

Please sign in to comment.