blob: 1ca7f7209701b2d6cc83a1ce53a8988600c55366 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#![cfg_attr(feature = "no_std", no_std)]
#[cfg(feature = "no_std")]
extern crate alloc;
#[cfg(feature = "no_std")]
use alloc::vec::Vec;
use sha2::{Digest, Sha256};
#[guests_macro::proving_entrypoint]
pub fn main(secret: Vec<u8>, hash: Vec<u8>) -> bool {
let mut hasher = Sha256::new();
hasher.update(secret);
let result = hasher.finalize();
let output: [u8; 32] = result.into();
output.to_vec() == hash
}
|