solutions/CCTF_Solutions_main/hash.zok

11 lines
409 B
Plaintext
Raw Normal View History

2022-12-06 14:25:51 +00:00
import "hashes/sha256/sha256Padded.zok" as sha256;
2022-12-06 14:58:40 +00:00
from "utils/casts.zok" import cast;
2022-12-06 14:25:51 +00:00
2022-12-06 19:34:54 +00:00
def main(public u32[5] address,private u8[64] flag) -> u32[8] {
2022-12-06 14:58:40 +00:00
u8[20] addr8 = cast(address);
2022-12-06 14:25:51 +00:00
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);
2022-12-06 19:34:54 +00:00
return genHash;
2022-12-06 14:25:51 +00:00
}