Removed gradle and added ZoKrates COde

comments
Bazsalanszky 2022-12-06 15:25:51 +01:00
parent e41f1a2e3e
commit ab0ca66da5
No known key found for this signature in database
GPG Key ID: B40814F4EFE23F96
3 changed files with 20 additions and 4 deletions

View File

@ -1,8 +1,5 @@
*.bpmn *.bpmn
root.zok
stateChange.zok
hash.zok
hash
# Compiled class file # Compiled class file
*.class *.class

View File

@ -0,0 +1,8 @@
import "hashes/sha256/sha256Padded.zok" as sha256;
def main(public u32[8] hash,private u8[8] flag) {
u32[8] genHash = sha256(flag);
log("Hash: {} {} {} {} {} {} {} {}",genHash[0],genHash[1],genHash[2],genHash[3],genHash[4],genHash[5],genHash[6],genHash[7]);
//assert(genHash == hash);
return;
}

View File

@ -0,0 +1,11 @@
import "hashes/sha256/sha256Padded.zok" as sha256;
from "utils/casts.zok" import cast;
def main(public u32[8] hash,public u32[5] address,private u8[8] flag) {
u8[20] addr8 = cast(address);
u8[28] forHash = [...addr8,...flag];
u32[8] genHash = sha256(flag);
log("Hash: {} {} {} {} {} {} {} {}",genHash[0],genHash[1],genHash[2],genHash[3],genHash[4],genHash[5],genHash[6],genHash[7]);
assert(genHash == hash);
return;
}