solutions/CCTF_Solutions_main/root.zok

11 lines
476 B
Plaintext

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[64] flag) -> u32[8]{
u8[20] addr8 = cast(address);
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);
u8[32] hash8 = cast(hash);
return sha256([...addr8,...hash8]);
}