Add reference implementation verification scripts
This commit is contained in:
24
ref-verification/hash.saw
Normal file
24
ref-verification/hash.saw
Normal file
@@ -0,0 +1,24 @@
|
||||
m <- llvm_load_module "hash.bc";
|
||||
|
||||
include "common.saw";
|
||||
|
||||
thm_P12 <- mk_P12;
|
||||
|
||||
thm_hash <- llvm_verify
|
||||
m "crypto_hash"
|
||||
[thm_P12]
|
||||
true
|
||||
do {
|
||||
let IN_len = 17;
|
||||
let IN_type = llvm_array IN_len (llvm_int 8);
|
||||
(IN, IN_ptr) <- fresh_alloc_readonly "IN" IN_type;
|
||||
|
||||
let OUT_type = llvm_array 32 (llvm_int 8);
|
||||
OUT_ptr <- llvm_alloc OUT_type;
|
||||
|
||||
llvm_execute_func [OUT_ptr, IN_ptr, llvm_term {{ `IN_len:[64] }}];
|
||||
|
||||
llvm_points_to OUT_ptr (llvm_term {{ Hash256_bytes IN }});
|
||||
llvm_return (llvm_term {{ 0 : [32] }});
|
||||
}
|
||||
abc;
|
Reference in New Issue
Block a user