Skip to content

Commit

Permalink
fix: use hash of [0u8;32] as default public input
Browse files Browse the repository at this point in the history
  • Loading branch information
weilzkm committed Nov 13, 2024
1 parent 35d2c97 commit 34cae6f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions prover/src/cpu/kernel/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ impl Kernel {

/// Read public input from input stream index 0
pub fn read_public_inputs(&self) -> Vec<u8> {
if let Some(first) = self.program.input_stream.first() {
let mut hasher = Sha256::new();
let public_input = if let Some(first) = self.program.input_stream.first() {
// bincode::deserialize::<Vec<u8>>(first).expect("deserialization failed")
let mut hasher = Sha256::new();
hasher.update(first);
let result = hasher.finalize();
result.to_vec()
first
} else {
vec![0u8; 32]
}
&vec![0u8; 32]
};

hasher.update(public_input);
let result = hasher.finalize();
result.to_vec()
}
}

0 comments on commit 34cae6f

Please sign in to comment.