mirror of
https://github.com/logos-blockchain/lssa-zkvm-testing.git
synced 2026-01-02 21:33:10 +00:00
add fix
This commit is contained in:
parent
7165d4d221
commit
513282cb48
0
risc0/short_tree_test/short_tree_proof.sh
Normal file → Executable file
0
risc0/short_tree_test/short_tree_proof.sh
Normal file → Executable file
@ -1,10 +1,9 @@
|
||||
use k256::elliptic_curve::group::GroupEncoding;
|
||||
use risc0_zkvm::{
|
||||
guest::env,
|
||||
sha::{Impl, Sha256},
|
||||
};
|
||||
use zerocopy::IntoBytes;
|
||||
use k256::elliptic_curve::group::GroupEncoding;
|
||||
|
||||
|
||||
fn main() {
|
||||
// read the input
|
||||
@ -21,21 +20,18 @@ fn main() {
|
||||
|
||||
//version
|
||||
//owner
|
||||
let mut array2 = [owner.to_bytes()];
|
||||
let mut array3 = [amount.try_into().unwrap()];
|
||||
//storage
|
||||
let array4 = [ nonce.try_into().unwrap(),
|
||||
privacy,
|
||||
const1.try_into().unwrap(),
|
||||
const2.try_into().unwrap(),];
|
||||
//array2.clone_from_slice(&array3);
|
||||
array3.clone_from_slice(&array4);
|
||||
let mut bytes_to_hash: [u8; 66] = [0; 66];
|
||||
|
||||
//array1.clone_from_slice(&array3);
|
||||
//array1.clone_from_slice(array4);
|
||||
|
||||
let _hash = Impl::hash_bytes(&array3);
|
||||
let owner_bytes: [u8; 33] = owner.to_bytes().try_into().unwrap();
|
||||
bytes_to_hash[..33].copy_from_slice(&owner_bytes);
|
||||
bytes_to_hash[33..41].copy_from_slice(&amount.to_le_bytes());
|
||||
bytes_to_hash[41..49].copy_from_slice(&nonce.to_le_bytes());
|
||||
bytes_to_hash[49..50].copy_from_slice(&privacy.to_le_bytes());
|
||||
bytes_to_hash[50..58].copy_from_slice(&const1.to_le_bytes());
|
||||
bytes_to_hash[58..].copy_from_slice(&const2.to_le_bytes());
|
||||
|
||||
let _hash = Impl::hash_bytes(&bytes_to_hash);
|
||||
|
||||
// write public output to the journal
|
||||
env::commit(&input);
|
||||
}
|
||||
}
|
||||
|
||||
0
risc0/single_hash/single_hash_without_proof.sh
Normal file → Executable file
0
risc0/single_hash/single_hash_without_proof.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user