effect
stringclasses
48 values
original_source_type
stringlengths
0
23k
opens_and_abbrevs
listlengths
2
92
isa_cross_project_example
bool
1 class
source_definition
stringlengths
9
57.9k
partial_definition
stringlengths
7
23.3k
is_div
bool
2 classes
is_type
null
is_proof
bool
2 classes
completed_definiton
stringlengths
1
250k
dependencies
dict
effect_flags
sequencelengths
0
2
ideal_premises
sequencelengths
0
236
mutual_with
sequencelengths
0
11
file_context
stringlengths
0
407k
interleaved
bool
1 class
is_simply_typed
bool
2 classes
file_name
stringlengths
5
48
vconfig
dict
is_simple_lemma
null
source_type
stringlengths
10
23k
proof_features
sequencelengths
0
1
name
stringlengths
8
95
source
dict
verbose_type
stringlengths
1
7.42k
source_range
dict
Prims.Ghost
val va_lemma_Loop_rounds_16_59_b : va_b0:va_code -> va_s0:va_state -> i:nat -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_59_b i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 20) (i == 36)) (i == 52) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block (i - 4)) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 1))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block i)) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 5))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_16_59_b va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_b va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 673 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 695 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_16_59_b : va_b0:va_code -> va_s0:va_state -> i:nat -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_59_b i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 20) (i == 36)) (i == 52) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block (i - 4)) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 1))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block i)) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 5))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Loop_rounds_16_59_b va_b0 va_s0 i block =
false
null
false
let va_mods:va_mods_t = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_b va_mods i block in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 673 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 695 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_16_59_b", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Prims.op_Addition", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_16_59_b" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_b i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_b (va_code_Loop_rounds_0_59_b i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_c i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_c (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 455 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 456 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 457 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 458 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 459 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 460 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 461 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_c i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_c (va_code_Loop_rounds_0_59_c i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_d [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_d i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_d i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_d (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_d i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 513 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 514 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 515 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 516 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 517 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 518 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 519 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 520 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_d va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_d va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_d i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 464 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 500 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 501 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 510 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 511 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_d i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_d (va_code_Loop_rounds_0_59_d i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_60_63_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_60_63_b () = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body 60) (va_CCons (va_code_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body 61) (va_CCons (va_code_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_60_63_b () = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 60) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 61) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_60_63_b (va_mods:va_mods_t) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_60_63_b ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 558 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 559 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 60 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 560 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 561 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 61 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 562 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 563 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QEmpty (()))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_60_63_b va_b0 va_s0 k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_60_63_b va_mods k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_60_63_b ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 556 column 133 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_60_63_b k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_60_63_b (va_code_Loop_rounds_60_63_b ()) va_s0 k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_3 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_3 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_3 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_3 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_3 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 580 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 581 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 582 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_3 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_1_3 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_3 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 566 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 578 column 38 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_3 (va_code_Loop_rounds_1_3 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_5_7 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_5_7 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_5_7 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_5_7 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_5_7 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 599 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 600 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 601 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_5_7 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_5_7 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_5_7 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 585 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 597 column 38 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_5_7 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_5_7 (va_code_Loop_rounds_5_7 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_9_11 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_9_11 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_9_11 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_9_11 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_9_11 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 618 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 619 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 620 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_9_11 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_9_11 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_9_11 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 604 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 616 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_9_11 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_9_11 (va_code_Loop_rounds_9_11 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_13_15 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_13_15 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_13_15 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_13_15 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_13_15 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 639 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_13_15 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_13_15 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_13_15 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 623 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 636 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_13_15 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_13_15 (va_code_Loop_rounds_13_15 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_a i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_a (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 667 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 668 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 669 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 670 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2) block) (va_QEmpty (()))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_59_a va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_a va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 643 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 665 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_59_a i block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_59_a (va_code_Loop_rounds_16_59_a i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_b i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_b (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 697 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 698 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 699 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 700 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6) block) (va_QEmpty (())))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_16_59_b : va_b0:va_code -> va_s0:va_state -> i:nat -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_59_b i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 20) (i == 36)) (i == 52) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block (i - 4)) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 1))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block i)) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 5))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_16_59_b
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 1945, "start_col": 54, "start_line": 1930 }
Prims.Ghost
val va_wpProof_Loop_rounds_16_59_c : i:nat -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_16_59_c i block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_16_59_c i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Loop_rounds_16_59_c i block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_59_c (va_code_Loop_rounds_16_59_c i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Loop_rounds_16_59_c : i:nat -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_16_59_c i block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_16_59_c i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Loop_rounds_16_59_c i block va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Loop_rounds_16_59_c (va_code_Loop_rounds_16_59_c i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0)))))) )); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9 ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Prims.nat", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Prims.Nil", "Prims._assert", "Vale.PPC64LE.Decls.va_state_eq", "Vale.PPC64LE.Decls.va_update_vec", "Vale.PPC64LE.Decls.va_update_ok", "Vale.PPC64LE.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_16_59_c", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_16_59_c" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_b i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_b (va_code_Loop_rounds_0_59_b i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_c i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_c (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 455 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 456 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 457 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 458 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 459 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 460 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 461 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_c i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_c (va_code_Loop_rounds_0_59_c i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_d [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_d i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_d i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_d (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_d i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 513 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 514 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 515 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 516 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 517 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 518 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 519 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 520 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_d va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_d va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_d i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 464 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 500 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 501 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 510 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 511 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_d i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_d (va_code_Loop_rounds_0_59_d i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_60_63_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_60_63_b () = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body 60) (va_CCons (va_code_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body 61) (va_CCons (va_code_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_60_63_b () = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 60) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 61) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_60_63_b (va_mods:va_mods_t) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_60_63_b ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 558 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 559 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 60 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 560 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 561 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 61 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 562 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 563 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QEmpty (()))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_60_63_b va_b0 va_s0 k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_60_63_b va_mods k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_60_63_b ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 556 column 133 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_60_63_b k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_60_63_b (va_code_Loop_rounds_60_63_b ()) va_s0 k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_3 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_3 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_3 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_3 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_3 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 580 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 581 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 582 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_3 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_1_3 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_3 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 566 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 578 column 38 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_3 (va_code_Loop_rounds_1_3 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_5_7 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_5_7 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_5_7 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_5_7 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_5_7 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 599 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 600 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 601 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_5_7 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_5_7 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_5_7 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 585 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 597 column 38 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_5_7 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_5_7 (va_code_Loop_rounds_5_7 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_9_11 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_9_11 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_9_11 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_9_11 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_9_11 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 618 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 619 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 620 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_9_11 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_9_11 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_9_11 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 604 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 616 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_9_11 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_9_11 (va_code_Loop_rounds_9_11 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_13_15 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_13_15 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_13_15 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_13_15 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_13_15 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 639 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_13_15 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_13_15 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_13_15 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 623 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 636 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_13_15 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_13_15 (va_code_Loop_rounds_13_15 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_a i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_a (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 667 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 668 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 669 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 670 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2) block) (va_QEmpty (()))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_59_a va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_a va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 643 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 665 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_59_a i block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_59_a (va_code_Loop_rounds_16_59_a i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_b i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_b (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 697 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 698 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 699 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 700 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6) block) (va_QEmpty (()))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_59_b va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_b va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 673 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 695 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_59_b i block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_59_b (va_code_Loop_rounds_16_59_b i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_c i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_c (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 727 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 728 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 729 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 730 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10) block) (va_QEmpty (()))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_59_c va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_c va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 725 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Loop_rounds_16_59_c : i:nat -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_16_59_c i block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_16_59_c i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_wpProof_Loop_rounds_16_59_c
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
i: Prims.nat -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 2037, "start_col": 55, "start_line": 2028 }
Prims.Ghost
val va_lemma_Loop_rounds_60_63_b : va_b0:va_code -> va_s0:va_state -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_60_63_b ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 60 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 60))) /\ l_and (l_and (l_and ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 60) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 61)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 62)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 63) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 61) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 62)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 63))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_60_63_b va_b0 va_s0 k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_60_63_b va_mods k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_60_63_b ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 556 column 133 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_60_63_b : va_b0:va_code -> va_s0:va_state -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_60_63_b ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 60 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 60))) /\ l_and (l_and (l_and ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 60) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 61)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 62)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 63) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 61) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 62)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 63))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))) let va_lemma_Loop_rounds_60_63_b va_b0 va_s0 k_b block hash_orig =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ] in let va_qc = va_qcode_Loop_rounds_60_63_b va_mods k_b block hash_orig in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_60_63_b ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 556 column 133 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_60_63_b", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_60_63_b" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_b i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_b (va_code_Loop_rounds_0_59_b i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_c i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_c (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 455 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 456 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 457 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 458 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 459 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 460 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 461 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_c i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_c (va_code_Loop_rounds_0_59_c i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_d [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_d i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_d i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_d (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_d i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 513 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 514 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 515 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 516 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 517 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 518 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 519 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 520 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_d va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_d va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_d i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 464 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 500 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 501 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 510 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 511 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_d i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_d (va_code_Loop_rounds_0_59_d i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_60_63_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_60_63_b () = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body 60) (va_CCons (va_code_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body 61) (va_CCons (va_code_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_60_63_b () = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 60) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 61) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_60_63_b (va_mods:va_mods_t) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_60_63_b ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 558 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 559 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 60 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 560 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 561 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 61 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 562 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 563 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QEmpty (())))))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_60_63_b : va_b0:va_code -> va_s0:va_state -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_60_63_b ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 60 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 60))) /\ l_and (l_and (l_and ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 60) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 61)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 62)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 63) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 61) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 62)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 63))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_60_63_b
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 1548, "start_col": 66, "start_line": 1530 }
Prims.Ghost
val va_lemma_Loop_rounds_16_59_c : va_b0:va_code -> va_s0:va_state -> i:nat -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_59_c i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 24) (i == 40)) (i == 56) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 6)) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 1))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block i)) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 11))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ l_and (l_and (l_and ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 4)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_16_59_c va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_c va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 725 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_16_59_c : va_b0:va_code -> va_s0:va_state -> i:nat -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_59_c i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 24) (i == 40)) (i == 56) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 6)) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 1))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block i)) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 11))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ l_and (l_and (l_and ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 4)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Loop_rounds_16_59_c va_b0 va_s0 i block =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok ] in let va_qc = va_qcode_Loop_rounds_16_59_c va_mods i block in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 725 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_16_59_c", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Prims.op_Addition", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_16_59_c" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_b i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_b (va_code_Loop_rounds_0_59_b i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_c i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_c (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 455 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 456 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 457 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 458 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 459 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 460 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 461 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_c i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_c (va_code_Loop_rounds_0_59_c i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_d [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_d i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_d i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_d (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_d i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 513 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 514 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 515 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 516 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 517 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 518 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 519 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 520 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_d va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_d va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_d i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 464 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 500 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 501 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 510 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 511 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_d i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_d (va_code_Loop_rounds_0_59_d i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_60_63_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_60_63_b () = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body 60) (va_CCons (va_code_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body 61) (va_CCons (va_code_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_60_63_b () = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 60) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body 61) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_60_63_b (va_mods:va_mods_t) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_60_63_b ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 558 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 60 (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 559 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 60 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 560 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 61 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 561 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body 61 k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 562 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 62 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 563 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body 63 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QEmpty (()))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_60_63_b va_b0 va_s0 k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_60_63_b va_mods k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_60_63_b ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 556 column 133 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_60_63_b k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_60_63_b (va_code_Loop_rounds_60_63_b ()) va_s0 k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_3 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_3 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_3 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_3 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_3 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 580 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 1 (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 581 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 2 (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 582 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 3 (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 0) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_3 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_1_3 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_3 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 566 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 578 column 38 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_3 (va_code_Loop_rounds_1_3 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_5_7 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_5_7 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_5_7 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_5_7 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_5_7 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 599 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 5 (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 600 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 6 (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 601 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 7 (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 4) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_5_7 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_5_7 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_5_7 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 585 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 597 column 38 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_5_7 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_5_7 (va_code_Loop_rounds_5_7 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_9_11 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_9_11 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_9_11 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_9_11 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_9_11 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 618 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 9 (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 619 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 10 (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 620 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 11 (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 8) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_9_11 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_9_11 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_9_11 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 604 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 616 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_9_11 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_9_11 (va_code_Loop_rounds_9_11 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_13_15 [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_13_15 () = (va_Block (va_CCons (va_code_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12)) (va_CCons (va_code_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12)) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_13_15 () = (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12)) (va_pbool_and (va_codegen_success_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_13_15 (va_mods:va_mods_t) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_13_15 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 13 (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 12) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 639 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 14 (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 12) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 32 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_1_15_shift_body 15 (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 12) block) (va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_13_15 va_b0 va_s0 block = let (va_mods:va_mods_t) = [va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_13_15 va_mods block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_13_15 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 623 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 636 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_13_15 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_13_15 (va_code_Loop_rounds_13_15 ()) va_s0 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_a i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_a (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 667 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 15) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 668 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 0) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 669 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 1) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 670 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 2) block) (va_QEmpty (()))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_59_a va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_a va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 643 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 665 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_59_a i block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_59_a (va_code_Loop_rounds_16_59_a i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_b i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_b (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 697 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 3) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 698 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 4) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 699 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 5) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 700 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6) block) (va_QEmpty (()))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_59_b va_b0 va_s0 i block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_16_59_b va_mods i block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 673 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 695 column 75 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and (l_and ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 4)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_59_b i block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_59_b (va_code_Loop_rounds_16_59_b i) va_s0 i block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_16_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9)) (va_CCons (va_code_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10)) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_59_c i = (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7)) (va_codegen_success_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8)) (va_codegen_success_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9)) (va_codegen_success_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9))) (va_pbool_and (va_pbool_and (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10)) (va_codegen_success_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10))) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_59_c (va_mods:va_mods_t) (i:nat) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 727 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 7) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 728 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 8) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 729 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 9) block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 730 column 27 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_16_63_body (i + 4) (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 10) block) (va_QEmpty (())))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_16_59_c : va_b0:va_code -> va_s0:va_state -> i:nat -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_59_c i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 24) (i == 40)) (i == 56) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 6)) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 1))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block i)) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 11))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ l_and (l_and (l_and ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 1)) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 4)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_16_59_c
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 2024, "start_col": 54, "start_line": 2009 }
Prims.Tot
val va_qcode_Loop_rounds_0_63_body (va_mods: va_mods_t) (i: nat) (msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec: vec_opr) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))))))))))))))))))))
val va_qcode_Loop_rounds_0_63_body (va_mods: va_mods_t) (i: nat) (msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec: vec_opr) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) let va_qcode_Loop_rounds_0_63_body (va_mods: va_mods_t) (i: nat) (msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec: vec_opr) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s: va_state) _ -> let va_arg53:Vale.Def.Words_s.nat32 = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let va_arg52:Vale.Def.Words_s.nat32 = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let va_arg51:Vale.Def.Words_s.nat32 = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_: unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s: va_state) _ -> let va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256 = hash_orig in let va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w = block in let va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_: unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_: unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let va_arg47:Vale.Def.Words_s.nat32 = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let va_arg46:Vale.Def.Words_s.nat32 = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let va_arg45:Vale.Def.Words_s.nat32 = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_: unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s: va_state) _ -> let va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256 = hash_orig in let va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w = block in let va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_: unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s: va_state) _ -> let va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256 = hash_orig in let va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w = block in let va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_: unit ) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41 ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63 ) (qblock va_mods ( fun ( va_s: va_state ) -> let va_arg38:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s g_vec in let va_arg37:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s f_vec in let va_arg36:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s e_vec in let va_arg35:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s d_vec in let va_arg34:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s c_vec in let va_arg33:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s b_vec in let va_arg32:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s a_vec in let va_arg31:Vale.Def.Types_s.quad32 = va_eval_vec_opr va_s h_vec in let va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256 = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ( fun ( _: unit ) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38 ) ( va_QEmpty ( () ) ) ) ) (qblock va_mods ( fun ( va_s: va_state ) -> va_QEmpty ( () ) ) )) (fun (va_s: va_state ) va_g -> va_QEmpty ( () ) )) )))))))))))))))) )))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[ "total" ]
[ "Vale.PPC64LE.QuickCode.va_mods_t", "Prims.nat", "Vale.PPC64LE.Decls.vec_opr", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.InsVector.va_code_Vadduwm", "Vale.PPC64LE.InsVector.va_code_Vsel", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.PPC64LE.QuickCodes.if_code", "Prims.op_disEquality", "Prims.int", "Vale.PPC64LE.QuickCodes.block", "Prims.Nil", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.InsVector.va_code_SHA256_Sigma1", "Vale.PPC64LE.InsVector.va_code_Vxor", "Vale.PPC64LE.InsVector.va_code_SHA256_Sigma0", "Prims.op_Equality", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.QuickCodes.va_QSeq", "Vale.PPC64LE.QuickCodes.va_range1", "Vale.PPC64LE.InsVector.va_quick_Vadduwm", "Vale.PPC64LE.QuickCodes.va_QBind", "Vale.PPC64LE.InsVector.va_quick_Vsel", "Vale.PPC64LE.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Vale.Def.Words_s.nat32", "Vale.Def.Sel.logsel", "Vale.Def.Types_s.ixor", "Vale.Def.Types_s.iand", "Vale.Def.Types_s.inot", "Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32", "Vale.PPC64LE.QuickCodes.va_qInlineIf", "Vale.PPC64LE.QuickCodes.va_QEmpty", "Vale.PPC64LE.QuickCodes.quickCodes", "Vale.PPC64LE.InsVector.va_quick_SHA256_Sigma1", "Prims.op_LessThan", "Prims.eq2", "Vale.SHA2.Wrapper.sigma256_1_1", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.SHA.PPC64LE.SHA_helpers.sigma_1_1_partial", "Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial", "Vale.PPC64LE.InsVector.va_quick_Vxor", "Vale.Def.Types_s.quad32", "Vale.Def.Types_s.quad32_xor", "Vale.Def.Types_s.quad32_xor_def", "Vale.Def.Types_s.quad32_xor_reveal", "Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32", "Vale.PPC64LE.InsVector.va_quick_SHA256_Sigma0", "Vale.SHA2.Wrapper.sigma256_1_0", "Vale.SHA.PPC64LE.SHA_helpers.sigma_1_0_partial", "Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial", "Vale.Def.Words_s.natN", "Spec.Loops.repeat_range", "FStar.Seq.Base.seq", "FStar.Seq.Base.length", "Prims.op_Addition", "Vale.SHA.PPC64LE.SHA_helpers.shuffle_core_opaque", "Vale.Def.Types_s.add_wrap", "Vale.SHA.PPC64LE.SHA_helpers.ch_256", "Vale.SHA.PPC64LE.SHA_helpers.k", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Vale.SHA.PPC64LE.SHA_helpers.maj_256", "Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32", "Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64", "Vale.PPC64LE.Decls.va_eval_vec_opr", "Vale.SHA.PPC64LE.SHA_helpers.counter", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCode.va_quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_63_body" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Loop_rounds_0_63_body (va_mods: va_mods_t) (i: nat) (msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec: vec_opr) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_0_63_body
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.PPC64LE.QuickCode.va_mods_t -> i: Prims.nat -> msg: Vale.PPC64LE.Decls.vec_opr -> a_vec: Vale.PPC64LE.Decls.vec_opr -> b_vec: Vale.PPC64LE.Decls.vec_opr -> c_vec: Vale.PPC64LE.Decls.vec_opr -> d_vec: Vale.PPC64LE.Decls.vec_opr -> e_vec: Vale.PPC64LE.Decls.vec_opr -> f_vec: Vale.PPC64LE.Decls.vec_opr -> g_vec: Vale.PPC64LE.Decls.vec_opr -> h_vec: Vale.PPC64LE.Decls.vec_opr -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)
{ "end_col": 29, "end_line": 407, "start_col": 2, "start_line": 324 }
Prims.Ghost
val va_lemma_Loop_rounds_0_59_a : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_a i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 0) (i == 16)) (i == 32)) (i == 48) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_0_59_a : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_a i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 0) (i == 16)) (i == 32)) (i == 48) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))) let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) )) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_59_a", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Prims.int", "Vale.PPC64LE.Decls.va_get_reg", "Prims.op_Addition", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_0_59_a" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (())))))))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_0_59_a : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_a i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 0) (i == 16)) (i == 32)) (i == 48) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_0_59_a
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 1047, "start_col": 67, "start_line": 1005 }
Prims.Ghost
val va_lemma_Loop_rounds_0_59_d : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_d i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 12) (i == 28)) (i == 44) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_0_59_d va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_d va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_d i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 464 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 500 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 501 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 510 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 511 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_0_59_d : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_d i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 12) (i == 28)) (i == 44) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))) let va_lemma_Loop_rounds_0_59_d va_b0 va_s0 i k_b block hash_orig =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ] in let va_qc = va_qcode_Loop_rounds_0_59_d va_mods i k_b block hash_orig in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_d i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 464 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 500 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 501 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 510 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 511 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) )) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_59_d", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Prims.int", "Vale.PPC64LE.Decls.va_get_reg", "Prims.op_Addition", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_0_59_d" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_b i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_b (va_code_Loop_rounds_0_59_b i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_c i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_c (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 455 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 456 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 457 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 458 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 459 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 460 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 461 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_c i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_c (va_code_Loop_rounds_0_59_c i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_d [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_d i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_d i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_d (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_d i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 513 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 12) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 514 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 515 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 13) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 516 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 517 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 14) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 518 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 519 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 15) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 520 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (())))))))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_0_59_d : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_d i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (i == 12) (i == 28)) (i == 44) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_0_59_d
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 1446, "start_col": 67, "start_line": 1404 }
Prims.Ghost
val va_lemma_Loop_rounds_0_59_c : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_c i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 8) (i == 24)) (i == 40)) (i == 56) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_0_59_c : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_c i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 8) (i == 24)) (i == 40)) (i == 56) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))) let va_lemma_Loop_rounds_0_59_c va_b0 va_s0 i k_b block hash_orig =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ] in let va_qc = va_qcode_Loop_rounds_0_59_c va_mods i k_b block hash_orig in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_c i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 405 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 441 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 442 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 451 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 452 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) )) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_59_c", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Prims.int", "Vale.PPC64LE.Decls.va_get_reg", "Prims.op_Addition", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_0_59_c" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_b i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_b (va_code_Loop_rounds_0_59_b i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_c [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_c i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_c i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_c (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_c i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 8) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 455 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 456 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 9) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 457 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 458 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 10) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 459 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 460 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 11) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 461 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (())))))))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_0_59_c : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_c i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 8) (i == 24)) (i == 40)) (i == 56) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_0_59_c
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 1313, "start_col": 67, "start_line": 1271 }
Prims.Ghost
val va_lemma_Loop_rounds_0_59_b : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_b i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 4) (i == 20)) (i == 36)) (i == 52) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_0_59_b : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_b i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 4) (i == 20)) (i == 36)) (i == 52) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))) let va_lemma_Loop_rounds_0_59_b va_b0 va_s0 i k_b block hash_orig =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ] in let va_qc = va_qcode_Loop_rounds_0_59_b va_mods i k_b block hash_orig in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_b i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 346 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 382 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 383 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 392 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) )) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_59_b", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Prims.int", "Vale.PPC64LE.Decls.va_get_reg", "Prims.op_Addition", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_0_59_b" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))) /\ (forall (va_x_d_vec:va_value_vec_opr) (va_x_g_vec:va_value_vec_opr) (va_x_h_vec:va_value_vec_opr) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_operand_vec_opr h_vec va_x_h_vec (va_upd_operand_vec_opr g_vec va_x_g_vec (va_upd_operand_vec_opr d_vec va_x_d_vec va_s0)))) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_63_body (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_63_body (i:nat) (msg:va_operand_vec_opr) (a_vec:va_operand_vec_opr) (b_vec:va_operand_vec_opr) (c_vec:va_operand_vec_opr) (d_vec:va_operand_vec_opr) (e_vec:va_operand_vec_opr) (f_vec:va_operand_vec_opr) (g_vec:va_operand_vec_opr) (h_vec:va_operand_vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (va_QProc (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) (va_wp_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig) (va_wpProof_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig)) //-- //-- Loop_round_0_61_body val va_code_Loop_round_0_61_body : i:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_round_0_61_body i = (va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_CNil ()))) else va_Block (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_round_0_61_body : i:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_round_0_61_body i = (va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_ttrue ())) else va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_round_0_61_body (va_mods:va_mods_t) (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 276 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_word4_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 24) (va_op_reg_opr_reg 6) Secret k_b ((i + 2) `op_Division` 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 6) (va_op_reg_opr_reg 6) 16) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 283 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) (va_op_vec_opr_vec 24) 4) (va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_round_0_61_body : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_round_0_61_body i) va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) /\ va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Loop_round_0_61_body va_b0 va_s0 i k_b = let (va_mods:va_mods_t) = [va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_round_0_61_body va_mods i k_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_round_0_61_body i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 254 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 77 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 272 column 57 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 273 column 122 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 274 column 97 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_round_0_61_body (i:nat) (k_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_and (0 <= i) (i < 62) /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_s0) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks) /\ (i `op_Modulus` 4 == 2 ==> Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b ((i + 2) `op_Division` 4) 1 (va_get_mem_layout va_s0) Secret /\ va_get_reg 6 va_s0 + 16 < pow2_64) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_s0).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_s0).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_s0).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_s0).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks))) /\ (forall (va_x_r6:nat64) (va_x_v24:quad32) . let va_sM = va_upd_vec 24 va_x_v24 (va_upd_reg 6 va_x_r6 va_s0) in va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_read k_b ((i + 2) `op_Division` 4) (va_get_mem_heaplet 0 va_sM) in (i `op_Modulus` 4 == 0 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 1 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0) /\ (i `op_Modulus` 4 == 2 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo0 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ (i `op_Modulus` 4 == 3 ==> (va_get_vec 24 va_sM).hi3 == Vale.Def.Words_s.__proj__Mkfour__item__lo1 ks /\ (va_get_vec 24 va_sM).hi2 == Vale.Def.Words_s.__proj__Mkfour__item__hi2 ks /\ (va_get_vec 24 va_sM).lo1 == Vale.Def.Words_s.__proj__Mkfour__item__hi3 ks /\ va_get_reg 6 va_sM == va_get_reg 6 va_s0)) ==> va_k va_sM (()))) val va_wpProof_Loop_round_0_61_body : i:nat -> k_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_round_0_61_body i k_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_round_0_61_body i k_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_round_0_61_body (va_code_Loop_round_0_61_body i) va_s0 i k_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 24 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_vec 24; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_round_0_61_body (i:nat) (k_b:buffer128) : (va_quickCode unit (va_code_Loop_round_0_61_body i)) = (va_QProc (va_code_Loop_round_0_61_body i) ([va_Mod_vec 24; va_Mod_reg 6]) (va_wp_Loop_round_0_61_body i k_b) (va_wpProof_Loop_round_0_61_body i k_b)) //-- //-- Loop_rounds_0_59_a [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_a i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_a i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_a (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_a i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 336 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 337 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 339 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 340 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 341 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 342 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 343 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_0_59_a va_b0 va_s0 i k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok] in let va_qc = va_qcode_Loop_rounds_0_59_a va_mods i k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_59_a i) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 287 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 323 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 86 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 23 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 19 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 334 column 95 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_0_59_a i k_b block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_0_59_a (va_code_Loop_rounds_0_59_a i) va_s0 i k_b block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_reg 6]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_59_b [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_59_b i = (va_Block (va_CCons (va_code_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_CCons (va_code_Loop_round_0_61_body i) (va_CCons (va_code_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_CCons (va_code_Loop_round_0_61_body (i + 1)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_CCons (va_code_Loop_round_0_61_body (i + 2)) (va_CCons (va_code_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_CCons (va_code_Loop_round_0_61_body (i + 3)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_59_b i = (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body i) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 1)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 2)) (va_pbool_and (va_codegen_success_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16)) (va_pbool_and (va_codegen_success_Loop_round_0_61_body (i + 3)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_59_b (va_mods:va_mods_t) (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_59_b i)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body i (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body i k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 1) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 1) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 2) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) (va_op_vec_opr_vec 17) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 2) k_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_rounds_0_63_body (i + 3) (va_op_vec_opr_vec 7) (va_op_vec_opr_vec 17) (va_op_vec_opr_vec 18) (va_op_vec_opr_vec 19) (va_op_vec_opr_vec 20) (va_op_vec_opr_vec 21) (va_op_vec_opr_vec 22) (va_op_vec_opr_vec 23) (va_op_vec_opr_vec 16) k_b block hash_orig) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Loop_round_0_61_body (i + 3) k_b) (va_QEmpty (())))))))))))
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_0_59_b : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_59_b i) va_s0 /\ va_get_ok va_s0 /\ (l_or (l_or (l_or (i == 4) (i == 20)) (i == 36)) (i == 52) /\ va_get_reg 6 va_s0 + 16 < pow2_64 /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 1 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 23 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 19 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i))) /\ l_and (l_and (l_and ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 1))) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 2))) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block (i + 3)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 16 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 4) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 4)))) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 5)) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 6))) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 7)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0)))))))))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_0_59_b
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 1180, "start_col": 67, "start_line": 1138 }
Prims.Ghost
val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) let va_lemma_Loop_rounds_0_63_body va_b0 va_s0 i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig =
false
null
false
let va_mods:va_mods_t = [ va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec ] in let va_qc = va_qcode_Loop_rounds_0_63_body va_mods i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec k_b block hash_orig in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 155 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 205 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in label va_range1 "***** POSTCONDITION NOT MET AT line 206 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in label va_range1 "***** POSTCONDITION NOT MET AT line 207 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in label va_range1 "***** POSTCONDITION NOT MET AT line 208 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in label va_range1 "***** POSTCONDITION NOT MET AT line 209 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) ) in label va_range1 "***** POSTCONDITION NOT MET AT line 210 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in label va_range1 "***** POSTCONDITION NOT MET AT line 211 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 212 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in label va_range1 "***** POSTCONDITION NOT MET AT line 213 column 137 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 214 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 215 column 93 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 224 column 61 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec ) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 ( va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 145 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 ( va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr h_vec; va_mod_vec_opr g_vec; va_mod_vec_opr d_vec ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.Core.fst.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.SHA.PPC64LE.Rounds.Core.fst" }
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Prims.nat", "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Vale.PPC64LE.QuickCode.va_mod_vec_opr", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.SHA.PPC64LE.Rounds.Core.va_code_Loop_rounds_0_63_body", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_eval_vec_opr", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Prims.op_Addition", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64", "Vale.SHA.PPC64LE.SHA_helpers.maj_256", "Vale.SHA2.Wrapper.sigma256_1_0", "Vale.SHA2.Wrapper.sigma256_1_1", "Vale.SHA.PPC64LE.SHA_helpers.ch_256", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.QuickCode.quickCode", "Vale.SHA.PPC64LE.Rounds.Core.va_qcode_Loop_rounds_0_63_body" ]
[]
module Vale.SHA.PPC64LE.Rounds.Core open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_3_7_11_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_3_7_11_body i msg = (va_Block (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_CNil ())))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_3_7_11_body i msg = (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_ttrue ()))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_3_7_11_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (in_b:buffer128) (offset:nat) : (va_quickCode unit (va_code_Loop_rounds_3_7_11_body i msg)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 26 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) msg (va_op_reg_opr_reg 4) Secret in_b offset) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_AddImm (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 4) 16) (va_QEmpty (()))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_3_7_11_body va_b0 va_s0 i msg in_b offset = let (va_mods:va_mods_t) = [va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg] in let va_qc = va_qcode_Loop_rounds_3_7_11_body va_mods i msg in_b offset in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_3_7_11_body i msg) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 55 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 76 column 73 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_eval_vec_opr va_sM msg == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read in_b offset (va_get_mem_heaplet 0 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 77 column 29 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 16))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_reg 4; va_Mod_ok; va_mod_vec_opr msg]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_3_7_11_body i msg in_b offset va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_3_7_11_body (va_code_Loop_rounds_3_7_11_body i msg) va_s0 i msg in_b offset in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg 4 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg 4; va_mod_vec_opr msg]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_1_15_shift_body val va_code_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_Block (va_CCons (if (i `op_Modulus` 4 = 1) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 4) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 2) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 8) (va_CNil ())) else va_Block (va_CCons (if (i `op_Modulus` 4 = 3) then va_Block (va_CCons (va_code_Vsldoi msg0 msg1 msg1 12) (va_CNil ())) else va_Block (va_CNil ())) (va_CNil ()))) (va_CNil ()))) (va_CNil ()))) val va_codegen_success_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_1_15_shift_body i msg0 msg1 = (va_pbool_and (if (i `op_Modulus` 4 = 1) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 4) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 2) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 8) (va_ttrue ()) else va_pbool_and (if (i `op_Modulus` 4 = 3) then va_pbool_and (va_codegen_success_Vsldoi msg0 msg1 msg1 12) (va_ttrue ()) else va_ttrue ()) (va_ttrue ())) (va_ttrue ())) (va_ttrue ())) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_1_15_shift_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 1) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 4) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 2) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 8) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 13 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i `op_Modulus` 4 = 3) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsldoi msg0 msg1 msg1 12) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))) (fun (va_s:va_state) va_g -> va_QEmpty (())))) val va_lemma_Loop_rounds_1_15_shift_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 /\ va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0)))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_1_15_shift_body va_b0 va_s0 i msg0 msg1 block = let (va_mods:va_mods_t) = [va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_1_15_shift_body va_mods i msg0 msg1 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 83 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 98 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_vec_opr msg0 va_s0 /\ va_is_src_vec_opr msg1 va_s0 /\ va_get_ok va_s0 /\ l_and (l_and (0 <= i) (i < 16)) (i `op_Modulus` 4 =!= 0) /\ msg0 == i /\ msg1 == i - i `op_Modulus` 4 /\ (i `op_Modulus` 4 == 1 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 2 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (i `op_Modulus` 4 == 3 ==> Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_s0 msg1) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i) /\ (forall (va_x_msg0:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr msg0 va_x_msg0 va_s0 in va_get_ok va_sM /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM msg0) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_1_15_shift_body : i:nat -> msg0:va_operand_vec_opr -> msg1:va_operand_vec_opr -> block:block_w -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_1_15_shift_body (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) va_s0 i msg0 msg1 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_1_15_shift_body (i:nat) (msg0:va_operand_vec_opr) (msg1:va_operand_vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_1_15_shift_body i msg0 msg1)) = (va_QProc (va_code_Loop_rounds_1_15_shift_body i msg0 msg1) ([va_mod_vec_opr msg0]) (va_wp_Loop_rounds_1_15_shift_body i msg0 msg1 block) (va_wpProof_Loop_rounds_1_15_shift_body i msg0 msg1 block)) //-- //-- Loop_rounds_16_63_body [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_Block (va_CCons (va_code_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_CCons (va_code_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vadduwm msg0 msg0 msg2) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 = (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1) (va_codegen_success_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25))) (va_pbool_and (va_pbool_and (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3) (va_codegen_success_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3)) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_codegen_success_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26))) (va_pbool_and (va_pbool_and (va_codegen_success_Vadduwm msg0 msg0 msg2) (va_codegen_success_Vadduwm msg0 msg0 msg2)) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_16_63_body (va_mods:va_mods_t) (i:nat) (msg0:vec_opr) (msg1:vec_opr) (msg2:vec_opr) (msg3:vec_opr) (block:block_w) : (va_quickCode unit (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 145 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma0 (va_op_vec_opr_vec 25) msg1 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 146 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_0_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 147 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 148 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_sigma1 (va_op_vec_opr_vec 26) msg3 i block) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 149 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_sigma_0_1_partial i block) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 150 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 (va_op_vec_opr_vec 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 151 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm msg0 msg0 msg2) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 152 column 20 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> lemma_ws_opaque block i) (va_QEmpty (()))))))))))) [@"opaque_to_smt"] let va_lemma_Loop_rounds_16_63_body va_b0 va_s0 i msg0 msg1 msg2 msg3 block = let (va_mods:va_mods_t) = [va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0] in let va_qc = va_qcode_Loop_rounds_16_63_body va_mods i msg0 msg1 msg2 msg3 block in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 114 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 140 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma0 = sigma256_0_0 (ws_opaque block (i - 15)) in label va_range1 "***** POSTCONDITION NOT MET AT line 141 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (let sigma1 = sigma256_0_1 (ws_opaque block (i - 2)) in label va_range1 "***** POSTCONDITION NOT MET AT line 142 column 118 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == add_wrap32 (add_wrap32 (add_wrap32 (ws_opaque block (i - 16)) sigma0) sigma1) (ws_opaque block (i - 7))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 143 column 40 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" ((va_eval_vec_opr va_sM msg0).hi3 == ws_opaque block i)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_ok; va_mod_vec_opr msg0]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3 block va_s0 va_k = let (va_sM, va_f0) = va_lemma_Loop_rounds_16_63_body (va_code_Loop_rounds_16_63_body i msg0 msg1 msg2 msg3) va_s0 i msg0 msg1 msg2 msg3 block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr msg0 va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 26; va_Mod_vec 25; va_mod_vec_opr msg0]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Loop_rounds_0_63_body val va_code_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_Block (va_CCons (va_code_Vadduwm h_vec h_vec msg) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_CCons (if op_disEquality i 63 then va_Block (va_CCons (va_code_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_CCons (va_code_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm d_vec d_vec h_vec) (va_CCons (va_code_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_CCons (va_code_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_CCons (va_code_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_CCons (if (i = 63) then va_Block (va_CNil ()) else va_Block (va_CNil ())) (va_CNil ()))))))))))))))) val va_codegen_success_Loop_rounds_0_63_body : i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec = (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec msg) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (va_pbool_and (if op_disEquality i 63 then va_pbool_and (va_codegen_success_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_pbool_and (va_codegen_success_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm d_vec d_vec h_vec) (va_pbool_and (va_codegen_success_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec) (va_pbool_and (va_codegen_success_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_pbool_and (va_codegen_success_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_pbool_and (if (i = 63) then va_ttrue () else va_ttrue ()) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Loop_rounds_0_63_body (va_mods:va_mods_t) (i:nat) (msg:vec_opr) (a_vec:vec_opr) (b_vec:vec_opr) (c_vec:vec_opr) (d_vec:vec_opr) (e_vec:vec_opr) (f_vec:vec_opr) (g_vec:vec_opr) (h_vec:vec_opr) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 227 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec msg) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 228 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) g_vec f_vec e_vec) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s e_vec) in let (va_arg52:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s g_vec) in let (va_arg51:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s f_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_vsel32 va_arg51 va_arg52 va_arg53) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 230 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (op_disEquality i 63) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 16 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm g_vec g_vec (va_op_vec_opr_vec 24)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 235 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma1 (va_op_vec_opr_vec 26) e_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg50:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg49:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg48:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 236 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_1_partial va_arg48 va_arg49 va_arg50) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 25) a_vec b_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 239 column 9 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vsel (va_op_vec_opr_vec 25) b_vec c_vec (va_op_vec_opr_vec 25)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 240 column 22 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg47:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s c_vec) in let (va_arg46:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s b_vec) in let (va_arg45:Vale.Def.Words_s.nat32) = Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s a_vec) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 241 column 25 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_eq_maj_xvsel32 va_arg45 va_arg46 va_arg47) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 242 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm d_vec d_vec h_vec) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 243 column 18 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_SHA256_Sigma0 (va_op_vec_opr_vec 26) a_vec i block hash_orig) (fun (va_s:va_state) _ -> let (va_arg44:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg43:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg42:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 244 column 28 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_sigma_1_0_partial va_arg42 va_arg43 va_arg44) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 245 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 26) (va_op_vec_opr_vec 25)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 246 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_quick_Vadduwm h_vec h_vec (va_op_vec_opr_vec 26)) (fun (va_s:va_state) _ -> let (va_arg41:Vale.SHA.PPC64LE.SHA_helpers.hash256) = hash_orig in let (va_arg40:Vale.SHA.PPC64LE.SHA_helpers.block_w) = block in let (va_arg39:Vale.SHA.PPC64LE.SHA_helpers.counter) = i in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 247 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_shuffle_core_properties va_arg39 va_arg40 va_arg41) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 248 column 15 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (va_qInlineIf va_mods (i = 63) (qblock va_mods (fun (va_s:va_state) -> let (va_arg38:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s g_vec in let (va_arg37:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s f_vec in let (va_arg36:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s e_vec in let (va_arg35:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s d_vec in let (va_arg34:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s c_vec in let (va_arg33:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s b_vec in let (va_arg32:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s a_vec in let (va_arg31:Vale.Def.Types_s.quad32) = va_eval_vec_opr va_s h_vec in let (va_arg30:Vale.SHA.PPC64LE.SHA_helpers.hash256) = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 250 column 34 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/sha/Vale.SHA.PPC64LE.Rounds.Core.vaf *****" (fun (_:unit) -> Vale.SHA.PPC64LE.SHA_helpers.lemma_make_seperated_hash va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 va_arg38) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))))))))))))))))))) val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0)))))))) [@"opaque_to_smt"]
false
false
Vale.SHA.PPC64LE.Rounds.Core.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Loop_rounds_0_63_body : va_b0:va_code -> va_s0:va_state -> i:nat -> msg:va_operand_vec_opr -> a_vec:va_operand_vec_opr -> b_vec:va_operand_vec_opr -> c_vec:va_operand_vec_opr -> d_vec:va_operand_vec_opr -> e_vec:va_operand_vec_opr -> f_vec:va_operand_vec_opr -> g_vec:va_operand_vec_opr -> h_vec:va_operand_vec_opr -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_63_body i msg a_vec b_vec c_vec d_vec e_vec f_vec g_vec h_vec) va_s0 /\ va_is_src_vec_opr msg va_s0 /\ va_is_src_vec_opr a_vec va_s0 /\ va_is_src_vec_opr b_vec va_s0 /\ va_is_src_vec_opr c_vec va_s0 /\ va_is_dst_vec_opr d_vec va_s0 /\ va_is_src_vec_opr e_vec va_s0 /\ va_is_src_vec_opr f_vec va_s0 /\ va_is_dst_vec_opr g_vec va_s0 /\ va_is_dst_vec_opr h_vec va_s0 /\ va_get_ok va_s0 /\ (l_and (0 <= i) (i < 64) /\ msg == i `op_Modulus` 16 /\ (i `op_Modulus` 8 == 0 ==> a_vec == 16 /\ b_vec == 17 /\ c_vec == 18 /\ d_vec == 19 /\ e_vec == 20 /\ f_vec == 21 /\ g_vec == 22 /\ h_vec == 23) /\ (i `op_Modulus` 8 == 1 ==> a_vec == 23 /\ b_vec == 16 /\ c_vec == 17 /\ d_vec == 18 /\ e_vec == 19 /\ f_vec == 20 /\ g_vec == 21 /\ h_vec == 22) /\ (i `op_Modulus` 8 == 2 ==> a_vec == 22 /\ b_vec == 23 /\ c_vec == 16 /\ d_vec == 17 /\ e_vec == 18 /\ f_vec == 19 /\ g_vec == 20 /\ h_vec == 21) /\ (i `op_Modulus` 8 == 3 ==> a_vec == 21 /\ b_vec == 22 /\ c_vec == 23 /\ d_vec == 16 /\ e_vec == 17 /\ f_vec == 18 /\ g_vec == 19 /\ h_vec == 20) /\ (i `op_Modulus` 8 == 4 ==> a_vec == 20 /\ b_vec == 21 /\ c_vec == 22 /\ d_vec == 23 /\ e_vec == 16 /\ f_vec == 17 /\ g_vec == 18 /\ h_vec == 19) /\ (i `op_Modulus` 8 == 5 ==> a_vec == 19 /\ b_vec == 20 /\ c_vec == 21 /\ d_vec == 22 /\ e_vec == 23 /\ f_vec == 16 /\ g_vec == 17 /\ h_vec == 18) /\ (i `op_Modulus` 8 == 6 ==> a_vec == 18 /\ b_vec == 19 /\ c_vec == 20 /\ d_vec == 21 /\ e_vec == 22 /\ f_vec == 23 /\ g_vec == 16 /\ h_vec == 17) /\ (i `op_Modulus` 8 == 7 ==> a_vec == 17 /\ b_vec == 18 /\ c_vec == 19 /\ d_vec == 20 /\ e_vec == 21 /\ f_vec == 22 /\ g_vec == 23 /\ h_vec == 16) /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 g_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 h_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_s0 msg) == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i /\ (i =!= 63 ==> (va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale i block hash_orig in let h_k = Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks i) in let ch = Vale.SHA.PPC64LE.SHA_helpers.ch_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) in let sigma1 = Vale.SHA2.Wrapper.sigma256_1_1 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4)) in let sigma0 = Vale.SHA2.Wrapper.sigma256_1_0 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) in let maj = Vale.SHA.PPC64LE.SHA_helpers.maj_256 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1)) (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2)) in let sigma0_maj = Vale.Arch.Types.add_wrap32 sigma0 maj in Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3)) (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) /\ Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 (Vale.Arch.Types.add_wrap32 h_k (Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block i)) ch) sigma1) sigma0_maj /\ (i =!= 63 ==> Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1))) /\ (i =!= 63 ==> (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale (i + 1) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM a_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1)) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM b_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM c_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM d_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM e_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM f_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM g_vec) == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks (i + 1)))) (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_sM h_vec) == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)))) /\ (i == 63 ==> Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_eval_vec_opr va_sM h_vec) (va_eval_vec_opr va_sM a_vec) (va_eval_vec_opr va_sM b_vec) (va_eval_vec_opr va_sM c_vec) (va_eval_vec_opr va_sM d_vec) (va_eval_vec_opr va_sM e_vec) (va_eval_vec_opr va_sM f_vec) (va_eval_vec_opr va_sM g_vec) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig)) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_ok va_sM (va_update_operand_vec_opr h_vec va_sM (va_update_operand_vec_opr g_vec va_sM (va_update_operand_vec_opr d_vec va_sM va_s0))))))))
[]
Vale.SHA.PPC64LE.Rounds.Core.va_lemma_Loop_rounds_0_63_body
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.Core.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> i: Prims.nat -> msg: Vale.PPC64LE.Decls.va_operand_vec_opr -> a_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> b_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> c_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> d_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> e_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> f_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> g_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> h_vec: Vale.PPC64LE.Decls.va_operand_vec_opr -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
{ "end_col": 16, "end_line": 612, "start_col": 29, "start_line": 524 }
FStar.Tactics.Effect.Tac
val check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term { Tm_Rewrite? t.term }) : T.Tac (checker_result_t g pre post_hint)
[ { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term{Tm_Rewrite? t.term}) : T.Tac (checker_result_t g pre post_hint) = let g = push_context "check_rewrite" t.range g in let Tm_Rewrite {t1=p; t2=q} = t.term in let (| p, p_typing |) = check_vprop g p in let (| q, q_typing |) = check_vprop g q in let equiv_p_q = if eq_tm p q then VE_Refl g p else let elab_p = elab_term p in let elab_q = elab_term q in let res, issues = T.check_equiv (elab_env g) elab_p elab_q in T.log_issues issues; match res with | None -> fail g (Some t.range) (Printf.sprintf "rewrite: could not prove equality of %s and %s\nElaborations: %s and %s\n" (P.term_to_string p) (P.term_to_string q) (T.term_to_string elab_p) (T.term_to_string elab_q)) | Some token -> VE_Ext g p q token in let d = T_Rewrite _ p q p_typing equiv_p_q in prove_post_hint (try_frame_pre pre_typing (match_comp_res_with_post_hint d post_hint) res_ppname) post_hint t.range
val check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term { Tm_Rewrite? t.term }) : T.Tac (checker_result_t g pre post_hint) let check (g: env) (pre: term) (pre_typing: tot_typing g pre tm_vprop) (post_hint: post_hint_opt g) (res_ppname: ppname) (t: st_term{Tm_Rewrite? t.term}) : T.Tac (checker_result_t g pre post_hint) =
true
null
false
let g = push_context "check_rewrite" t.range g in let Tm_Rewrite { t1 = p ; t2 = q } = t.term in let (| p , p_typing |) = check_vprop g p in let (| q , q_typing |) = check_vprop g q in let equiv_p_q = if eq_tm p q then VE_Refl g p else let elab_p = elab_term p in let elab_q = elab_term q in let res, issues = T.check_equiv (elab_env g) elab_p elab_q in T.log_issues issues; match res with | None -> fail g (Some t.range) (Printf.sprintf "rewrite: could not prove equality of %s and %s\nElaborations: %s and %s\n" (P.term_to_string p) (P.term_to_string q) (T.term_to_string elab_p) (T.term_to_string elab_q)) | Some token -> VE_Ext g p q token in let d = T_Rewrite _ p q p_typing equiv_p_q in prove_post_hint (try_frame_pre pre_typing (match_comp_res_with_post_hint d post_hint) res_ppname) post_hint t.range
{ "checked_file": "Pulse.Checker.Rewrite.fst.checked", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Rewrite.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Syntax.Base.tm_vprop", "Pulse.Typing.post_hint_opt", "Pulse.Syntax.Base.ppname", "Pulse.Syntax.Base.st_term", "Prims.b2t", "Pulse.Syntax.Base.uu___is_Tm_Rewrite", "Pulse.Syntax.Base.__proj__Mkst_term__item__term", "Pulse.Checker.Prover.prove_post_hint", "Pulse.Syntax.Base.__proj__Mkst_term__item__range", "Pulse.Checker.Base.checker_result_t", "FStar.Pervasives.Native.None", "Pulse.Typing.post_hint_t", "Pulse.Checker.Prover.try_frame_pre", "FStar.Pervasives.dtuple3", "Pulse.Syntax.Base.comp_st", "Pulse.Typing.st_typing", "Pulse.Checker.Base.match_comp_res_with_post_hint", "Pulse.Typing.wtag", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.ctag", "Pulse.Syntax.Base.STT_Ghost", "Pulse.Syntax.Base.Tm_Rewrite", "Pulse.Syntax.Base.Mkst_term'__Tm_Rewrite__payload", "Pulse.Typing.comp_rewrite", "Pulse.Typing.T_Rewrite", "Pulse.Typing.vprop_equiv", "Pulse.Syntax.Base.eq_tm", "Pulse.Typing.VE_Refl", "Prims.bool", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.equiv_token", "Pulse.Typing.elab_env", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail", "Pulse.Syntax.Base.range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string", "FStar.Tactics.V2.Builtins.term_to_string", "Pulse.Typing.VE_Ext", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "FStar.Tactics.V2.Builtins.check_equiv", "FStar.Tactics.V2.Builtins.ret_t", "FStar.Reflection.Types.term", "Pulse.Elaborate.Pure.elab_term", "Prims.dtuple2", "Pulse.Checker.Pure.check_vprop", "Pulse.Syntax.Base.st_term'", "Prims.eq2", "Pulse.Checker.Pure.push_context" ]
[]
module Pulse.Checker.Rewrite open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base open Pulse.Checker.Prover module T = FStar.Tactics.V2 module P = Pulse.Syntax.Printer let check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term{Tm_Rewrite? t.term})
false
false
Pulse.Checker.Rewrite.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term { Tm_Rewrite? t.term }) : T.Tac (checker_result_t g pre post_hint)
[]
Pulse.Checker.Rewrite.check
{ "file_name": "lib/steel/pulse/Pulse.Checker.Rewrite.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> pre: Pulse.Syntax.Base.term -> pre_typing: Pulse.Typing.tot_typing g pre Pulse.Syntax.Base.tm_vprop -> post_hint: Pulse.Typing.post_hint_opt g -> res_ppname: Pulse.Syntax.Base.ppname -> t: Pulse.Syntax.Base.st_term{Tm_Rewrite? (Mkst_term?.term t)} -> FStar.Tactics.Effect.Tac (Pulse.Checker.Base.checker_result_t g pre post_hint)
{ "end_col": 116, "end_line": 44, "start_col": 46, "start_line": 20 }
Prims.Tot
val va_req_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : prop
[ { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : prop = (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret))
val va_req_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : prop let va_req_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : prop =
false
null
false
(va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let key_ptr:(va_int_range 0 18446744073709551615) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let key_expansion_ptr:(va_int_range 0 18446744073709551615) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret))
{ "checked_file": "Vale.AES.X64.AES.fsti.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.Stack.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.AES256.fsti.checked", "Vale.AES.X64.AES128.fsti.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES256_helpers.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AES.fsti" }
[ "total" ]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.bool", "Vale.AES.AES_common_s.algorithm", "Vale.X64.Memory.buffer128", "Prims.l_and", "Vale.X64.Decls.va_require_total", "Vale.AES.X64.AES.va_code_KeyExpansionStdcall", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Vale.X64.Memory.is_initial_heap", "Vale.X64.Decls.va_get_mem_layout", "Vale.X64.Decls.va_get_mem", "Vale.X64.CPU_Features_s.aesni_enabled", "Vale.X64.CPU_Features_s.avx_enabled", "Vale.X64.CPU_Features_s.sse_enabled", "Prims.l_or", "Prims.op_Equality", "Vale.AES.AES_common_s.AES_128", "Vale.AES.AES_common_s.AES_256", "Vale.X64.Decls.buffers_disjoint128", "Vale.X64.Decls.validSrcAddrs128", "Prims.int", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.Decls.validDstAddrs128", "Prims.op_Addition", "Vale.AES.AES_common_s.nr", "FStar.Seq.Base.seq", "Vale.Def.Words_s.nat32", "Vale.Arch.Types.quad32_to_seq", "Vale.X64.Decls.buffer128_read", "Vale.AES.AES256_helpers.make_AES256_key", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdi", "Prims.prop" ]
[]
module Vale.AES.X64.AES open Vale.Def.Types_s open FStar.Seq open Vale.Arch.HeapImpl open Vale.AES.AES_s open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsVector //open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.Arch.Types //open Vale.AES.AES_helpers open Vale.AES.AES256_helpers open Vale.Def.Opaque_s open Vale.AES.X64.AES128 open Vale.AES.X64.AES256 open Vale.AES.GCTR open Vale.X64.CPU_Features_s open Vale.X64.Stack #reset-options "--z3rlimit 20" //-- KeyExpansionStdcall val va_code_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_code val va_codegen_success_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_pbool let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm)
false
true
Vale.AES.X64.AES.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_req_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : prop
[]
Vale.AES.X64.AES.va_req_KeyExpansionStdcall
{ "file_name": "obj/Vale.AES.X64.AES.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> win: Prims.bool -> alg: Vale.AES.AES_common_s.algorithm -> input_key_b: Vale.X64.Memory.buffer128 -> output_key_expansion_b: Vale.X64.Memory.buffer128 -> Prims.prop
{ "end_col": 38, "end_line": 47, "start_col": 2, "start_line": 33 }
Prims.Tot
val va_quick_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg))
[ { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_quick_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg)) = (va_QProc (va_code_KeyExpansionStdcall win alg) ([va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem]) (va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b) (va_wpProof_KeyExpansionStdcall win alg input_key_b output_key_expansion_b))
val va_quick_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg)) let va_quick_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg)) =
false
null
false
(va_QProc (va_code_KeyExpansionStdcall win alg) ([ va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem ]) (va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b) (va_wpProof_KeyExpansionStdcall win alg input_key_b output_key_expansion_b))
{ "checked_file": "Vale.AES.X64.AES.fsti.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.Stack.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.AES256.fsti.checked", "Vale.AES.X64.AES128.fsti.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES256_helpers.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AES.fsti" }
[ "total" ]
[ "Prims.bool", "Vale.AES.AES_common_s.algorithm", "Vale.X64.Memory.buffer128", "Vale.X64.QuickCode.va_QProc", "Prims.unit", "Vale.AES.X64.AES.va_code_KeyExpansionStdcall", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_xmm", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Vale.AES.X64.AES.va_wp_KeyExpansionStdcall", "Vale.AES.X64.AES.va_wpProof_KeyExpansionStdcall", "Vale.X64.QuickCode.va_quickCode" ]
[]
module Vale.AES.X64.AES open Vale.Def.Types_s open FStar.Seq open Vale.Arch.HeapImpl open Vale.AES.AES_s open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsVector //open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.Arch.Types //open Vale.AES.AES_helpers open Vale.AES.AES256_helpers open Vale.Def.Opaque_s open Vale.AES.X64.AES128 open Vale.AES.X64.AES256 open Vale.AES.GCTR open Vale.X64.CPU_Features_s open Vale.X64.Stack #reset-options "--z3rlimit 20" //-- KeyExpansionStdcall val va_code_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_code val va_codegen_success_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_pbool let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : prop = (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret)) let va_ens_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) : prop = (va_req_KeyExpansionStdcall va_b0 va_s0 win alg input_key_b output_key_expansion_b /\ va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) val va_lemma_KeyExpansionStdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@ va_qattr] let va_wp_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (va_if (alg = AES_128) (fun _ -> 1) (fun _ -> 2)) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rdx:nat64) (va_x_heap1:vale_heap) (va_x_memLayout:vale_heap_layout) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_mem_layout va_x_memLayout (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_reg64 rRdx va_x_rdx (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionStdcall : win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionStdcall win alg) ([va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128)
false
false
Vale.AES.X64.AES.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_quick_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg))
[]
Vale.AES.X64.AES.va_quick_KeyExpansionStdcall
{ "file_name": "obj/Vale.AES.X64.AES.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
win: Prims.bool -> alg: Vale.AES.AES_common_s.algorithm -> input_key_b: Vale.X64.Memory.buffer128 -> output_key_expansion_b: Vale.X64.Memory.buffer128 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.AES.X64.AES.va_code_KeyExpansionStdcall win alg)
{ "end_col": 80, "end_line": 150, "start_col": 2, "start_line": 147 }
Prims.Tot
val va_quick_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AESEncryptBlock alg))
[ { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_quick_AESEncryptBlock (alg:algorithm) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AESEncryptBlock alg)) = (va_QProc (va_code_AESEncryptBlock alg) ([va_Mod_flags; va_Mod_xmm 2; va_Mod_xmm 0]) (va_wp_AESEncryptBlock alg input key round_keys keys_buffer) (va_wpProof_AESEncryptBlock alg input key round_keys keys_buffer))
val va_quick_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AESEncryptBlock alg)) let va_quick_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AESEncryptBlock alg)) =
false
null
false
(va_QProc (va_code_AESEncryptBlock alg) ([va_Mod_flags; va_Mod_xmm 2; va_Mod_xmm 0]) (va_wp_AESEncryptBlock alg input key round_keys keys_buffer) (va_wpProof_AESEncryptBlock alg input key round_keys keys_buffer))
{ "checked_file": "Vale.AES.X64.AES.fsti.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.Stack.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.AES256.fsti.checked", "Vale.AES.X64.AES128.fsti.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES256_helpers.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AES.fsti" }
[ "total" ]
[ "Vale.AES.AES_common_s.algorithm", "Vale.X64.Decls.quad32", "FStar.Seq.Base.seq", "Vale.X64.Memory.nat32", "Vale.X64.Memory.buffer128", "Vale.X64.QuickCode.va_QProc", "Prims.unit", "Vale.AES.X64.AES.va_code_AESEncryptBlock", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_xmm", "Prims.Nil", "Vale.AES.X64.AES.va_wp_AESEncryptBlock", "Vale.AES.X64.AES.va_wpProof_AESEncryptBlock", "Vale.X64.QuickCode.va_quickCode" ]
[]
module Vale.AES.X64.AES open Vale.Def.Types_s open FStar.Seq open Vale.Arch.HeapImpl open Vale.AES.AES_s open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsVector //open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.Arch.Types //open Vale.AES.AES_helpers open Vale.AES.AES256_helpers open Vale.Def.Opaque_s open Vale.AES.X64.AES128 open Vale.AES.X64.AES256 open Vale.AES.GCTR open Vale.X64.CPU_Features_s open Vale.X64.Stack #reset-options "--z3rlimit 20" //-- KeyExpansionStdcall val va_code_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_code val va_codegen_success_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_pbool let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : prop = (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret)) let va_ens_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) : prop = (va_req_KeyExpansionStdcall va_b0 va_s0 win alg input_key_b output_key_expansion_b /\ va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) val va_lemma_KeyExpansionStdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@ va_qattr] let va_wp_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (va_if (alg = AES_128) (fun _ -> 1) (fun _ -> 2)) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rdx:nat64) (va_x_heap1:vale_heap) (va_x_memLayout:vale_heap_layout) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_mem_layout va_x_memLayout (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_reg64 rRdx va_x_rdx (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionStdcall : win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionStdcall win alg) ([va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg)) = (va_QProc (va_code_KeyExpansionStdcall win alg) ([va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem]) (va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b) (va_wpProof_KeyExpansionStdcall win alg input_key_b output_key_expansion_b)) //-- //-- AESEncryptBlock val va_code_AESEncryptBlock : alg:algorithm -> Tot va_code val va_codegen_success_AESEncryptBlock : alg:algorithm -> Tot va_pbool val va_lemma_AESEncryptBlock : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> input:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AESEncryptBlock alg) va_s0 /\ va_get_ok va_s0 /\ (aesni_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.AES.AES_s.is_aes_key_LE alg key /\ FStar.Seq.Base.length #quad32 round_keys == Vale.AES.AES_common_s.nr alg + 1 /\ round_keys == Vale.AES.AES_s.key_to_round_keys_LE alg key /\ va_get_xmm 0 va_s0 == input /\ va_get_reg64 rR8 va_s0 == Vale.X64.Memory.buffer_addr #Vale.X64.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR8 va_s0) keys_buffer (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret /\ (forall (i:nat) . i < Vale.AES.AES_common_s.nr alg + 1 ==> Vale.X64.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0) == FStar.Seq.Base.index #quad32 round_keys i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_xmm 0 va_sM == Vale.AES.AES_s.aes_encrypt_LE alg key input /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 2 va_sM (va_update_xmm 0 va_sM (va_update_ok va_sM va_s0)))))) [@ va_qattr] let va_wp_AESEncryptBlock (alg:algorithm) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (aesni_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.AES.AES_s.is_aes_key_LE alg key /\ FStar.Seq.Base.length #quad32 round_keys == Vale.AES.AES_common_s.nr alg + 1 /\ round_keys == Vale.AES.AES_s.key_to_round_keys_LE alg key /\ va_get_xmm 0 va_s0 == input /\ va_get_reg64 rR8 va_s0 == Vale.X64.Memory.buffer_addr #Vale.X64.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR8 va_s0) keys_buffer (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret /\ (forall (i:nat) . i < Vale.AES.AES_common_s.nr alg + 1 ==> Vale.X64.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0) == FStar.Seq.Base.index #quad32 round_keys i) /\ (forall (va_x_xmm0:quad32) (va_x_xmm2:quad32) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 0 va_x_xmm0 va_s0)) in va_get_ok va_sM /\ va_get_xmm 0 va_sM == Vale.AES.AES_s.aes_encrypt_LE alg key input ==> va_k va_sM (()))) val va_wpProof_AESEncryptBlock : alg:algorithm -> input:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AESEncryptBlock alg input key round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AESEncryptBlock alg) ([va_Mod_flags; va_Mod_xmm 2; va_Mod_xmm 0]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_AESEncryptBlock (alg:algorithm) (input:quad32) (key:(seq nat32)) (round_keys:(seq
false
false
Vale.AES.X64.AES.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_quick_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AESEncryptBlock alg))
[]
Vale.AES.X64.AES.va_quick_AESEncryptBlock
{ "file_name": "obj/Vale.AES.X64.AES.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
alg: Vale.AES.AES_common_s.algorithm -> input: Vale.X64.Decls.quad32 -> key: FStar.Seq.Base.seq Vale.X64.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.X64.Decls.quad32 -> keys_buffer: Vale.X64.Memory.buffer128 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.AES.X64.AES.va_code_AESEncryptBlock alg)
{ "end_col": 38, "end_line": 204, "start_col": 2, "start_line": 202 }
Prims.Tot
val va_wp_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[ { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wp_AESEncryptBlock (alg:algorithm) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (aesni_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.AES.AES_s.is_aes_key_LE alg key /\ FStar.Seq.Base.length #quad32 round_keys == Vale.AES.AES_common_s.nr alg + 1 /\ round_keys == Vale.AES.AES_s.key_to_round_keys_LE alg key /\ va_get_xmm 0 va_s0 == input /\ va_get_reg64 rR8 va_s0 == Vale.X64.Memory.buffer_addr #Vale.X64.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR8 va_s0) keys_buffer (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret /\ (forall (i:nat) . i < Vale.AES.AES_common_s.nr alg + 1 ==> Vale.X64.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0) == FStar.Seq.Base.index #quad32 round_keys i) /\ (forall (va_x_xmm0:quad32) (va_x_xmm2:quad32) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 0 va_x_xmm0 va_s0)) in va_get_ok va_sM /\ va_get_xmm 0 va_sM == Vale.AES.AES_s.aes_encrypt_LE alg key input ==> va_k va_sM (())))
val va_wp_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 let va_wp_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 =
false
null
false
(va_get_ok va_s0 /\ (aesni_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.AES.AES_s.is_aes_key_LE alg key /\ FStar.Seq.Base.length #quad32 round_keys == Vale.AES.AES_common_s.nr alg + 1 /\ round_keys == Vale.AES.AES_s.key_to_round_keys_LE alg key /\ va_get_xmm 0 va_s0 == input /\ va_get_reg64 rR8 va_s0 == Vale.X64.Memory.buffer_addr #Vale.X64.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR8 va_s0) keys_buffer (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret /\ (forall (i: nat). i < Vale.AES.AES_common_s.nr alg + 1 ==> Vale.X64.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0) == FStar.Seq.Base.index #quad32 round_keys i) /\ (forall (va_x_xmm0: quad32) (va_x_xmm2: quad32) (va_x_efl: Vale.X64.Flags.t). let va_sM = va_upd_flags va_x_efl (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 0 va_x_xmm0 va_s0)) in va_get_ok va_sM /\ va_get_xmm 0 va_sM == Vale.AES.AES_s.aes_encrypt_LE alg key input ==> va_k va_sM (())))
{ "checked_file": "Vale.AES.X64.AES.fsti.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.Stack.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.AES256.fsti.checked", "Vale.AES.X64.AES128.fsti.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES256_helpers.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AES.fsti" }
[ "total" ]
[ "Vale.AES.AES_common_s.algorithm", "Vale.X64.Decls.quad32", "FStar.Seq.Base.seq", "Vale.X64.Memory.nat32", "Vale.X64.Memory.buffer128", "Vale.X64.Decls.va_state", "Prims.unit", "Prims.l_and", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Vale.X64.CPU_Features_s.aesni_enabled", "Vale.X64.CPU_Features_s.sse_enabled", "Prims.l_or", "Prims.op_Equality", "Vale.AES.AES_common_s.AES_128", "Vale.AES.AES_common_s.AES_256", "Vale.AES.AES_s.is_aes_key_LE", "Prims.eq2", "Prims.int", "FStar.Seq.Base.length", "Prims.op_Addition", "Vale.AES.AES_common_s.nr", "Vale.Def.Types_s.quad32", "Vale.AES.AES_s.key_to_round_keys_LE", "Vale.X64.Decls.va_get_xmm", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rR8", "Vale.X64.Memory.buffer_addr", "Vale.X64.Memory.vuint128", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.Decls.validSrcAddrs128", "Vale.X64.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Prims.l_Forall", "Prims.nat", "Prims.l_imp", "Prims.op_LessThan", "Vale.X64.Decls.buffer128_read", "FStar.Seq.Base.index", "Vale.X64.Flags.t", "Vale.AES.AES_s.aes_encrypt_LE", "Vale.X64.State.vale_state", "Vale.X64.Decls.va_upd_flags", "Vale.X64.Decls.va_upd_xmm" ]
[]
module Vale.AES.X64.AES open Vale.Def.Types_s open FStar.Seq open Vale.Arch.HeapImpl open Vale.AES.AES_s open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsVector //open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.Arch.Types //open Vale.AES.AES_helpers open Vale.AES.AES256_helpers open Vale.Def.Opaque_s open Vale.AES.X64.AES128 open Vale.AES.X64.AES256 open Vale.AES.GCTR open Vale.X64.CPU_Features_s open Vale.X64.Stack #reset-options "--z3rlimit 20" //-- KeyExpansionStdcall val va_code_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_code val va_codegen_success_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_pbool let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : prop = (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret)) let va_ens_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) : prop = (va_req_KeyExpansionStdcall va_b0 va_s0 win alg input_key_b output_key_expansion_b /\ va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) val va_lemma_KeyExpansionStdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@ va_qattr] let va_wp_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (va_if (alg = AES_128) (fun _ -> 1) (fun _ -> 2)) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rdx:nat64) (va_x_heap1:vale_heap) (va_x_memLayout:vale_heap_layout) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_mem_layout va_x_memLayout (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_reg64 rRdx va_x_rdx (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionStdcall : win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionStdcall win alg) ([va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansionStdcall win alg)) = (va_QProc (va_code_KeyExpansionStdcall win alg) ([va_Mod_flags; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_mem_layout; va_Mod_mem_heaplet 1; va_Mod_reg64 rRdx; va_Mod_mem]) (va_wp_KeyExpansionStdcall win alg input_key_b output_key_expansion_b) (va_wpProof_KeyExpansionStdcall win alg input_key_b output_key_expansion_b)) //-- //-- AESEncryptBlock val va_code_AESEncryptBlock : alg:algorithm -> Tot va_code val va_codegen_success_AESEncryptBlock : alg:algorithm -> Tot va_pbool val va_lemma_AESEncryptBlock : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> input:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AESEncryptBlock alg) va_s0 /\ va_get_ok va_s0 /\ (aesni_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.AES.AES_s.is_aes_key_LE alg key /\ FStar.Seq.Base.length #quad32 round_keys == Vale.AES.AES_common_s.nr alg + 1 /\ round_keys == Vale.AES.AES_s.key_to_round_keys_LE alg key /\ va_get_xmm 0 va_s0 == input /\ va_get_reg64 rR8 va_s0 == Vale.X64.Memory.buffer_addr #Vale.X64.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR8 va_s0) keys_buffer (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret /\ (forall (i:nat) . i < Vale.AES.AES_common_s.nr alg + 1 ==> Vale.X64.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0) == FStar.Seq.Base.index #quad32 round_keys i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_xmm 0 va_sM == Vale.AES.AES_s.aes_encrypt_LE alg key input /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 2 va_sM (va_update_xmm 0 va_sM (va_update_ok va_sM va_s0)))))) [@ va_qattr] let va_wp_AESEncryptBlock (alg:algorithm) (input:quad32) (key:(seq nat32)) (round_keys:(seq
false
true
Vale.AES.X64.AES.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wp_AESEncryptBlock (alg: algorithm) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[]
Vale.AES.X64.AES.va_wp_AESEncryptBlock
{ "file_name": "obj/Vale.AES.X64.AES.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
alg: Vale.AES.AES_common_s.algorithm -> input: Vale.X64.Decls.quad32 -> key: FStar.Seq.Base.seq Vale.X64.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.X64.Decls.quad32 -> keys_buffer: Vale.X64.Memory.buffer128 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Type0
{ "end_col": 91, "end_line": 189, "start_col": 2, "start_line": 178 }
Prims.Tot
val va_ens_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_sM: va_state) (va_fM: va_fuel) : prop
[ { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_ens_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) : prop = (va_req_KeyExpansionStdcall va_b0 va_s0 win alg input_key_b output_key_expansion_b /\ va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))
val va_ens_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_sM: va_state) (va_fM: va_fuel) : prop let va_ens_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_sM: va_state) (va_fM: va_fuel) : prop =
false
null
false
(va_req_KeyExpansionStdcall va_b0 va_s0 win alg input_key_b output_key_expansion_b /\ va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let key_ptr:(va_int_range 0 18446744073709551615) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let key_expansion_ptr:(va_int_range 0 18446744073709551615) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j. 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))
{ "checked_file": "Vale.AES.X64.AES.fsti.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.Stack.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.AES256.fsti.checked", "Vale.AES.X64.AES128.fsti.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES256_helpers.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AES.fsti" }
[ "total" ]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.bool", "Vale.AES.AES_common_s.algorithm", "Vale.X64.Memory.buffer128", "Vale.X64.Decls.va_fuel", "Prims.l_and", "Vale.AES.X64.AES.va_req_KeyExpansionStdcall", "Vale.X64.Decls.va_ensure_total", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Vale.X64.Decls.modifies_buffer128", "Vale.X64.Decls.va_get_mem", "Prims.l_Forall", "Prims.int", "Prims.op_GreaterThanOrEqual", "Prims.op_LessThan", "FStar.Seq.Base.length", "Vale.Def.Types_s.quad32", "Vale.AES.AES_s.key_to_round_keys_LE", "Prims.l_imp", "Prims.op_LessThanOrEqual", "Vale.AES.AES_common_s.nr", "Prims.eq2", "Vale.X64.Decls.buffer128_read", "FStar.Seq.Base.index", "FStar.Seq.Base.seq", "Vale.Def.Words_s.nat32", "Prims.op_Equality", "Vale.AES.AES_common_s.AES_128", "Vale.Arch.Types.quad32_to_seq", "Vale.AES.AES256_helpers.make_AES256_key", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdi", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_xmm", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Prims.prop" ]
[]
module Vale.AES.X64.AES open Vale.Def.Types_s open FStar.Seq open Vale.Arch.HeapImpl open Vale.AES.AES_s open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsVector //open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.Arch.Types //open Vale.AES.AES_helpers open Vale.AES.AES256_helpers open Vale.Def.Opaque_s open Vale.AES.X64.AES128 open Vale.AES.X64.AES256 open Vale.AES.GCTR open Vale.X64.CPU_Features_s open Vale.X64.Stack #reset-options "--z3rlimit 20" //-- KeyExpansionStdcall val va_code_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_code val va_codegen_success_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_pbool let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : prop = (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret)) let va_ens_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) :
false
true
Vale.AES.X64.AES.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_ens_KeyExpansionStdcall (va_b0: va_code) (va_s0: va_state) (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_sM: va_state) (va_fM: va_fuel) : prop
[]
Vale.AES.X64.AES.va_ens_KeyExpansionStdcall
{ "file_name": "obj/Vale.AES.X64.AES.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> win: Prims.bool -> alg: Vale.AES.AES_common_s.algorithm -> input_key_b: Vale.X64.Memory.buffer128 -> output_key_expansion_b: Vale.X64.Memory.buffer128 -> va_sM: Vale.X64.Decls.va_state -> va_fM: Vale.X64.Decls.va_fuel -> Prims.prop
{ "end_col": 26, "end_line": 66, "start_col": 2, "start_line": 51 }
Prims.Tot
val va_wp_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[ { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES256", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AES128", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wp_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (va_if (alg = AES_128) (fun _ -> 1) (fun _ -> 2)) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rdx:nat64) (va_x_heap1:vale_heap) (va_x_memLayout:vale_heap_layout) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_mem_layout va_x_memLayout (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_reg64 rRdx va_x_rdx (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) ==> va_k va_sM (())))
val va_wp_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 let va_wp_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 =
false
null
false
(va_get_ok va_s0 /\ (let key_ptr:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let key_expansion_ptr:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (va_if (alg = AES_128) (fun _ -> 1) (fun _ -> 2)) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem: vale_heap) (va_x_rdx: nat64) (va_x_heap1: vale_heap) (va_x_memLayout: vale_heap_layout) (va_x_xmm1: quad32) (va_x_xmm2: quad32) (va_x_xmm3: quad32) (va_x_xmm4: quad32) (va_x_efl: Vale.X64.Flags.t). let va_sM = va_upd_flags va_x_efl (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_mem_layout va_x_memLayout (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_reg64 rRdx va_x_rdx (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let key_ptr:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let key_expansion_ptr:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32) = va_if (alg = AES_128) (fun _ -> Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0))) (fun _ -> Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j. 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) ==> va_k va_sM (())))
{ "checked_file": "Vale.AES.X64.AES.fsti.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.Stack.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.AES256.fsti.checked", "Vale.AES.X64.AES128.fsti.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES256_helpers.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AES.fsti" }
[ "total" ]
[ "Prims.bool", "Vale.AES.AES_common_s.algorithm", "Vale.X64.Memory.buffer128", "Vale.X64.Decls.va_state", "Prims.unit", "Prims.l_and", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Vale.X64.Memory.is_initial_heap", "Vale.X64.Decls.va_get_mem_layout", "Vale.X64.Decls.va_get_mem", "Vale.X64.CPU_Features_s.aesni_enabled", "Vale.X64.CPU_Features_s.avx_enabled", "Vale.X64.CPU_Features_s.sse_enabled", "Prims.l_or", "Prims.op_Equality", "Vale.AES.AES_common_s.AES_128", "Vale.AES.AES_common_s.AES_256", "Vale.X64.Decls.buffers_disjoint128", "Vale.X64.Decls.validSrcAddrs128", "Vale.X64.Decls.va_if", "Prims.int", "Prims.l_not", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.Decls.validDstAddrs128", "Prims.op_Addition", "Vale.AES.AES_common_s.nr", "FStar.Seq.Base.seq", "Vale.Def.Words_s.nat32", "Vale.Arch.Types.quad32_to_seq", "Vale.X64.Decls.buffer128_read", "Vale.AES.AES256_helpers.make_AES256_key", "Vale.X64.Decls.va_int_range", "Vale.Def.Types_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdi", "Prims.l_Forall", "Vale.X64.InsBasic.vale_heap", "Vale.X64.Memory.nat64", "Vale.Arch.HeapImpl.vale_heap_layout", "Vale.X64.Decls.quad32", "Vale.X64.Flags.t", "Prims.l_imp", "Vale.X64.Decls.modifies_buffer128", "Prims.op_GreaterThanOrEqual", "Prims.op_LessThan", "FStar.Seq.Base.length", "Vale.Def.Types_s.quad32", "Vale.AES.AES_s.key_to_round_keys_LE", "Prims.op_LessThanOrEqual", "Prims.eq2", "FStar.Seq.Base.index", "Vale.X64.State.vale_state", "Vale.X64.Decls.va_upd_flags", "Vale.X64.Decls.va_upd_xmm", "Vale.X64.Decls.va_upd_mem_layout", "Vale.X64.Decls.va_upd_mem_heaplet", "Vale.X64.Decls.va_upd_reg64", "Vale.X64.Decls.va_upd_mem" ]
[]
module Vale.AES.X64.AES open Vale.Def.Types_s open FStar.Seq open Vale.Arch.HeapImpl open Vale.AES.AES_s open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsVector //open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.Arch.Types //open Vale.AES.AES_helpers open Vale.AES.AES256_helpers open Vale.Def.Opaque_s open Vale.AES.X64.AES128 open Vale.AES.X64.AES256 open Vale.AES.GCTR open Vale.X64.CPU_Features_s open Vale.X64.Stack #reset-options "--z3rlimit 20" //-- KeyExpansionStdcall val va_code_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_code val va_codegen_success_KeyExpansionStdcall : win:bool -> alg:algorithm -> Tot va_pbool let va_req_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : prop = (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret)) let va_ens_KeyExpansionStdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (alg:algorithm) (input_key_b:buffer128) (output_key_expansion_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) : prop = (va_req_KeyExpansionStdcall va_b0 va_s0 win alg input_key_b output_key_expansion_b /\ va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) val va_lemma_KeyExpansionStdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> alg:algorithm -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionStdcall win alg) va_s0 /\ va_get_ok va_s0 /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (aesni_enabled /\ avx_enabled /\ sse_enabled) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.X64.Decls.buffers_disjoint128 input_key_b output_key_expansion_b /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem va_s0) key_ptr input_key_b (if (alg = AES_128) then 1 else 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem va_s0) key_expansion_ptr output_key_expansion_b (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (key_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (key_expansion_ptr:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = (if (alg = AES_128) then Vale.Arch.Types.quad32_to_seq (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) else Vale.AES.AES256_helpers.make_AES256_key (Vale.X64.Decls.buffer128_read input_key_b 0 (va_get_mem va_s0)) (Vale.X64.Decls.buffer128_read input_key_b 1 (va_get_mem va_s0))) in Vale.X64.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (forall j . 0 <= j /\ j <= Vale.AES.AES_common_s.nr alg ==> Vale.X64.Decls.buffer128_read output_key_expansion_b j (va_get_mem va_sM) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_s.key_to_round_keys_LE alg key) j)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@ va_qattr] let va_wp_KeyExpansionStdcall (win:bool) (alg:algorithm) (input_key_b:buffer128)
false
true
Vale.AES.X64.AES.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wp_KeyExpansionStdcall (win: bool) (alg: algorithm) (input_key_b output_key_expansion_b: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[]
Vale.AES.X64.AES.va_wp_KeyExpansionStdcall
{ "file_name": "obj/Vale.AES.X64.AES.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
win: Prims.bool -> alg: Vale.AES.AES_common_s.algorithm -> input_key_b: Vale.X64.Memory.buffer128 -> output_key_expansion_b: Vale.X64.Memory.buffer128 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Type0
{ "end_col": 75, "end_line": 134, "start_col": 2, "start_line": 104 }
Prims.Tot
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t]
let mk_squash t =
false
null
false
let sq:R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t]
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[ "total" ]
[ "FStar.Reflection.Types.term", "FStar.Reflection.V2.Derived.mk_e_app", "Prims.Cons", "Prims.Nil", "FStar.Reflection.V2.Builtins.pack_ln", "FStar.Reflection.V2.Data.Tv_UInst", "FStar.Reflection.V2.Builtins.pack_fv", "FStar.Reflection.Const.squash_qn", "FStar.Reflection.Types.universe", "Pulse.Syntax.Pure.u_zero" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res
false
true
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mk_squash : t: FStar.Reflection.Types.term -> FStar.Reflection.Types.term
[]
Pulse.Checker.Pure.mk_squash
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
t: FStar.Reflection.Types.term -> FStar.Reflection.Types.term
{ "end_col": 17, "end_line": 84, "start_col": 17, "start_line": 82 }
Prims.Tot
val exn_as_issue (e: exn) : FStar.Issue.issue
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None []
val exn_as_issue (e: exn) : FStar.Issue.issue let exn_as_issue (e: exn) : FStar.Issue.issue =
false
null
false
FStar.Issue.mk_issue "Error" (RU.print_exn e) None None []
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[ "total" ]
[ "Prims.exn", "FStar.Issue.mk_issue", "Pulse.RuntimeUtils.print_exn", "FStar.Pervasives.Native.None", "FStar.Range.range", "Prims.int", "Prims.Nil", "Prims.string", "FStar.Issue.issue" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues
false
true
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val exn_as_issue (e: exn) : FStar.Issue.issue
[]
Pulse.Checker.Pure.exn_as_issue
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
e: Prims.exn -> FStar.Issue.issue
{ "end_col": 60, "end_line": 102, "start_col": 2, "start_line": 102 }
FStar.Tactics.Effect.Tac
val core_check_tot_term_with_expected_type (g:env) (e:term) (t:typ) : T.Tac (tot_typing g e t)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let core_check_tot_term_with_expected_type g e t = core_check_term_with_expected_type g e T.E_Total t
val core_check_tot_term_with_expected_type (g:env) (e:term) (t:typ) : T.Tac (tot_typing g e t) let core_check_tot_term_with_expected_type g e t =
false
null
false
core_check_term_with_expected_type g e T.E_Total t
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Syntax.Base.typ", "Pulse.Checker.Pure.core_check_term_with_expected_type", "FStar.Stubs.TypeChecker.Core.E_Total", "Pulse.Typing.typing", "Pulse.Typing.tot_typing" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_with_expected_type g e t = check_term_with_expected_type_and_effect g e T.E_Total t let core_check_tot_term g t = let (| eff, ty, d |) = core_check_term g t in if eff = T.E_Total then (| ty, d |) else fail_expected_tot_found_ghost g t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val core_check_tot_term_with_expected_type (g:env) (e:term) (t:typ) : T.Tac (tot_typing g e t)
[]
Pulse.Checker.Pure.core_check_tot_term_with_expected_type
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> e: Pulse.Syntax.Base.term -> t: Pulse.Syntax.Base.typ -> FStar.Tactics.Effect.Tac (Pulse.Typing.tot_typing g e t)
{ "end_col": 52, "end_line": 393, "start_col": 2, "start_line": 393 }
Prims.Tot
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"]
let pulse_lib_gref =
false
null
false
["Pulse"; "Lib"; "GhostReference"]
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[ "total" ]
[ "Prims.Cons", "Prims.string", "Prims.Nil" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop
false
true
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val pulse_lib_gref : Prims.list Prims.string
[]
Pulse.Checker.Pure.pulse_lib_gref
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
Prims.list Prims.string
{ "end_col": 55, "end_line": 310, "start_col": 21, "start_line": 310 }
Prims.Tot
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let gref_lid = mk_pulse_lib_gref_lid "ref"
let gref_lid =
false
null
false
mk_pulse_lib_gref_lid "ref"
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[ "total" ]
[ "Pulse.Checker.Pure.mk_pulse_lib_gref_lid" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s]
false
true
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val gref_lid : Prims.list Prims.string
[]
Pulse.Checker.Pure.gref_lid
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
Prims.list Prims.string
{ "end_col": 42, "end_line": 313, "start_col": 15, "start_line": 313 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res
let rtb_tc_term g f e =
true
null
false
let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "FStar.Reflection.Types.env", "FStar.Reflection.Types.term", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.option", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.typing_token", "FStar.Pervasives.Native.fst", "FStar.Pervasives.Native.snd", "FStar.Tactics.Types.issues", "FStar.Tactics.V2.Builtins.tc_term", "FStar.Tactics.V2.Builtins.ret_t", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.range_to_string", "Pulse.RuntimeUtils.range_of_term", "FStar.Tactics.V2.Builtins.term_to_string", "Prims.eq2", "Pulse.RuntimeUtils.deep_transform_to_unary_applications" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_tc_term : g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (r: (FStar.Reflection.Types.term * (FStar.Stubs.TypeChecker.Core.tot_or_ghost * FStar.Reflection.Types.typ)) { FStar.Tactics.Types.typing_token f (FStar.Pervasives.Native.fst r) (FStar.Pervasives.Native.snd r) }) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_tc_term
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (r: (FStar.Reflection.Types.term * (FStar.Stubs.TypeChecker.Core.tot_or_ghost * FStar.Reflection.Types.typ)) { FStar.Tactics.Types.typing_token f (FStar.Pervasives.Native.fst r) (FStar.Pervasives.Native.snd r) }) * FStar.Tactics.Types.issues)
{ "end_col": 5, "end_line": 39, "start_col": 23, "start_line": 31 }
Prims.Tot
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s]
let mk_pulse_lib_gref_lid s =
false
null
false
pulse_lib_gref @ [s]
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[ "total" ]
[ "Prims.string", "FStar.List.Tot.Base.op_At", "Pulse.Checker.Pure.pulse_lib_gref", "Prims.Cons", "Prims.Nil", "Prims.list" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop
false
true
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mk_pulse_lib_gref_lid : s: Prims.string -> Prims.list Prims.string
[]
Pulse.Checker.Pure.mk_pulse_lib_gref_lid
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
s: Prims.string -> Prims.list Prims.string
{ "end_col": 48, "end_line": 311, "start_col": 30, "start_line": 311 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res
let rtb_universe_of g f e =
true
null
false
debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "FStar.Reflection.Types.env", "FStar.Reflection.Types.term", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.option", "FStar.Reflection.Types.universe", "FStar.Tactics.Types.typing_token", "FStar.Pervasives.Native.Mktuple2", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Reflection.Types.typ", "FStar.Stubs.TypeChecker.Core.E_Total", "FStar.Reflection.V2.Builtins.pack_ln", "FStar.Reflection.V2.Data.Tv_Type", "FStar.Tactics.Types.issues", "FStar.Tactics.V2.Builtins.universe_of", "FStar.Tactics.V2.Builtins.ret_t", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.range_to_string", "Pulse.RuntimeUtils.range_of_term", "FStar.Tactics.V2.Builtins.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_universe_of : g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (u17: FStar.Reflection.Types.universe { FStar.Tactics.Types.typing_token f e (FStar.Stubs.TypeChecker.Core.E_Total, FStar.Reflection.V2.Builtins.pack_ln (FStar.Reflection.V2.Data.Tv_Type u17)) }) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_universe_of
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (u17: FStar.Reflection.Types.universe { FStar.Tactics.Types.typing_token f e (FStar.Stubs.TypeChecker.Core.E_Total, FStar.Reflection.V2.Builtins.pack_ln (FStar.Reflection.V2.Data.Tv_Type u17)) }) * FStar.Tactics.Types.issues)
{ "end_col": 5, "end_line": 47, "start_col": 2, "start_line": 42 }
FStar.Tactics.Effect.Tac
val check_tot_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & tot_typing g e t)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_tot_term_with_expected_type g e t = check_term_with_expected_type_and_effect g e T.E_Total t
val check_tot_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & tot_typing g e t) let check_tot_term_with_expected_type g e t =
false
null
false
check_term_with_expected_type_and_effect g e T.E_Total t
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Checker.Pure.check_term_with_expected_type_and_effect", "FStar.Stubs.TypeChecker.Core.E_Total", "Prims.dtuple2", "Pulse.Typing.typing", "Pulse.Typing.tot_typing" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_tot_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & tot_typing g e t)
[]
Pulse.Checker.Pure.check_tot_term_with_expected_type
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> e: Pulse.Syntax.Base.term -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Prims.dtuple2 Pulse.Syntax.Base.term (fun e -> Pulse.Typing.tot_typing g e t))
{ "end_col": 58, "end_line": 385, "start_col": 2, "start_line": 385 }
FStar.Tactics.Effect.Tac
val check_equiv (g:env) (t1 t2:term) : T.Tac (option (T.equiv_token (elab_env g) (elab_term t1) (elab_term t2)))
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_equiv g t1 t2 = let res, issues = Pulse.Typing.Util.check_equiv_now (elab_env g) (elab_term t1) (elab_term t2) in T.log_issues issues; res
val check_equiv (g:env) (t1 t2:term) : T.Tac (option (T.equiv_token (elab_env g) (elab_term t1) (elab_term t2))) let check_equiv g t1 t2 =
true
null
false
let res, issues = Pulse.Typing.Util.check_equiv_now (elab_env g) (elab_term t1) (elab_term t2) in T.log_issues issues; res
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.equiv_token", "Pulse.Typing.elab_env", "Pulse.Elaborate.Pure.elab_term", "FStar.Tactics.Types.issues", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Typing.Util.check_equiv_now" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_with_expected_type g e t = check_term_with_expected_type_and_effect g e T.E_Total t let core_check_tot_term g t = let (| eff, ty, d |) = core_check_term g t in if eff = T.E_Total then (| ty, d |) else fail_expected_tot_found_ghost g t let core_check_tot_term_with_expected_type g e t = core_check_term_with_expected_type g e T.E_Total t let is_non_informative g c = let ropt, issues = catch_all (fun _ -> T.is_non_informative (elab_env g) (elab_comp c)) in T.log_issues issues; ropt let check_subtyping g t1 t2 = T.with_policy SMTSync (fun () -> let res, issues = rtb_check_subtyping g t1 t2 in T.log_issues issues; match res with | Some tok -> tok | None -> fail g (Some t1.range) (Printf.sprintf "Could not prove subtyping of %s and %s" (P.term_to_string t1) (P.term_to_string t2)) )
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_equiv (g:env) (t1 t2:term) : T.Tac (option (T.equiv_token (elab_env g) (elab_term t1) (elab_term t2)))
[]
Pulse.Checker.Pure.check_equiv
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t1: Pulse.Syntax.Base.term -> t2: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.Types.equiv_token (Pulse.Typing.elab_env g) (Pulse.Elaborate.Pure.elab_term t1) (Pulse.Elaborate.Pure.elab_term t2)))
{ "end_col": 5, "end_line": 418, "start_col": 25, "start_line": 414 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg())
let debug (g: env) (msg: (unit -> T.Tac string)) =
true
null
false
let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg ())
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Prims.unit", "Prims.string", "Prims.op_BarBar", "Pulse.RuntimeUtils.debug_at_level", "Pulse.Typing.Env.fstar_env", "FStar.Tactics.V2.Builtins.print", "Prims.op_Hat", "Pulse.Typing.Env.print_context", "Prims.bool", "FStar.Tactics.V2.Builtins.debugging" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val debug : g: Pulse.Typing.Env.env -> msg: (_: Prims.unit -> FStar.Tactics.Effect.Tac Prims.string) -> FStar.Tactics.Effect.Tac Prims.unit
[]
Pulse.Checker.Pure.debug
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> msg: (_: Prims.unit -> FStar.Tactics.Effect.Tac Prims.string) -> FStar.Tactics.Effect.Tac Prims.unit
{ "end_col": 47, "end_line": 21, "start_col": 47, "start_line": 18 }
FStar.Tactics.Effect.Tac
val check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |)
val check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) let check_term_with_expected_type (g: env) (e t: term) : T.Tac (e: term & eff: T.tot_or_ghost & typing g e eff t) =
false
null
false
try let (| e , et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e: term & eff: T.tot_or_ghost & typing g e eff t) with | _ -> let (| e , et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Tactics.V2.Derived.try_with", "FStar.Pervasives.dtuple3", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "Pulse.Typing.typing", "Prims.unit", "FStar.Stubs.TypeChecker.Core.E_Total", "FStar.Pervasives.Mkdtuple3", "Prims.dtuple2", "Pulse.Checker.Pure.check_term_with_expected_type_and_effect", "Prims.exn", "FStar.Stubs.TypeChecker.Core.E_Ghost" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term)
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t)
[]
Pulse.Checker.Pure.check_term_with_expected_type
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> e: Pulse.Syntax.Base.term -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple3 Pulse.Syntax.Base.term (fun _ -> FStar.Stubs.TypeChecker.Core.tot_or_ghost) (fun e eff -> Pulse.Typing.typing g e eff t))
{ "end_col": 26, "end_line": 254, "start_col": 2, "start_line": 249 }
FStar.Tactics.Effect.Tac
val is_non_informative (g:env) (c:comp) : T.Tac (option (T.non_informative_token (elab_env g) (elab_comp c)))
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let is_non_informative g c = let ropt, issues = catch_all (fun _ -> T.is_non_informative (elab_env g) (elab_comp c)) in T.log_issues issues; ropt
val is_non_informative (g:env) (c:comp) : T.Tac (option (T.non_informative_token (elab_env g) (elab_comp c))) let is_non_informative g c =
true
null
false
let ropt, issues = catch_all (fun _ -> T.is_non_informative (elab_env g) (elab_comp c)) in T.log_issues issues; ropt
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.comp", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.non_informative_token", "Pulse.Typing.elab_env", "Pulse.Elaborate.Pure.elab_comp", "FStar.Tactics.Types.issues", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.catch_all", "FStar.Tactics.V2.Builtins.is_non_informative", "FStar.Tactics.V2.Builtins.ret_t" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_with_expected_type g e t = check_term_with_expected_type_and_effect g e T.E_Total t let core_check_tot_term g t = let (| eff, ty, d |) = core_check_term g t in if eff = T.E_Total then (| ty, d |) else fail_expected_tot_found_ghost g t let core_check_tot_term_with_expected_type g e t = core_check_term_with_expected_type g e T.E_Total t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val is_non_informative (g:env) (c:comp) : T.Tac (option (T.non_informative_token (elab_env g) (elab_comp c)))
[]
Pulse.Checker.Pure.is_non_informative
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> c: Pulse.Syntax.Base.comp -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.Types.non_informative_token (Pulse.Typing.elab_env g) (Pulse.Elaborate.Pure.elab_comp c)))
{ "end_col": 6, "end_line": 398, "start_col": 28, "start_line": 395 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res
let rtb_core_check_term g f e =
true
null
false
debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "FStar.Reflection.Types.env", "FStar.Reflection.Types.term", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.option", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.typing_token", "FStar.Tactics.Types.issues", "FStar.Tactics.V2.Builtins.core_compute_term_type", "FStar.Tactics.V2.Builtins.ret_t", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.range_to_string", "Pulse.RuntimeUtils.range_of_term", "FStar.Tactics.V2.Builtins.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg())
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_core_check_term : g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (r: (FStar.Stubs.TypeChecker.Core.tot_or_ghost * FStar.Reflection.Types.typ) {FStar.Tactics.Types.typing_token f e r}) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_core_check_term
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (r: (FStar.Stubs.TypeChecker.Core.tot_or_ghost * FStar.Reflection.Types.typ) {FStar.Tactics.Types.typing_token f e r}) * FStar.Tactics.Types.issues)
{ "end_col": 5, "end_line": 29, "start_col": 2, "start_line": 24 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res
let rtb_core_check_term_at_type g f e eff t =
true
null
false
debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "FStar.Reflection.Types.env", "FStar.Reflection.Types.term", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.typing_token", "FStar.Pervasives.Native.Mktuple2", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.issues", "FStar.Tactics.V2.Builtins.core_check_term", "FStar.Tactics.V2.Builtins.ret_t", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.range_to_string", "Pulse.RuntimeUtils.range_of_term", "FStar.Tactics.V2.Builtins.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_core_check_term_at_type : g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> eff: FStar.Stubs.TypeChecker.Core.tot_or_ghost -> t: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.Types.typing_token f e (eff, t)) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_core_check_term_at_type
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> e: FStar.Reflection.Types.term -> eff: FStar.Stubs.TypeChecker.Core.tot_or_ghost -> t: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.Types.typing_token f e (eff, t)) * FStar.Tactics.Types.issues)
{ "end_col": 5, "end_line": 80, "start_col": 2, "start_line": 74 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res
let rtb_check_subtyping g (t1: term) (t2: term) =
true
null
false
debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.subtyping_token", "Pulse.Typing.elab_env", "Pulse.Elaborate.Pure.elab_term", "FStar.Tactics.Types.issues", "FStar.Tactics.V2.Builtins.check_subtyping", "FStar.Tactics.V2.Builtins.ret_t", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.range_to_string", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Pulse.Syntax.Printer.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_check_subtyping : g: Pulse.Typing.Env.env -> t1: Pulse.Syntax.Base.term -> t2: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.Types.subtyping_token (Pulse.Typing.elab_env g) (Pulse.Elaborate.Pure.elab_term t1) (Pulse.Elaborate.Pure.elab_term t2)) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_check_subtyping
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t1: Pulse.Syntax.Base.term -> t2: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.Types.subtyping_token (Pulse.Typing.elab_env g) (Pulse.Elaborate.Pure.elab_term t1) (Pulse.Elaborate.Pure.elab_term t2)) * FStar.Tactics.Types.issues)
{ "end_col": 5, "end_line": 57, "start_col": 2, "start_line": 50 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s)
let readback_failure (s: R.term) =
true
null
false
Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "FStar.Reflection.Types.term", "FStar.Printf.sprintf", "Prims.string", "FStar.Tactics.V2.Builtins.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val readback_failure : s: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (Prims.string <: Type0)
[]
Pulse.Checker.Pure.readback_failure
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
s: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (Prims.string <: Type0)
{ "end_col": 37, "end_line": 113, "start_col": 2, "start_line": 112 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t))
let fail_expected_tot_found_ghost (g: env) (t: term) =
true
null
false
fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t))
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.Env.fail", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val fail_expected_tot_found_ghost : g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac _
[]
Pulse.Checker.Pure.fail_expected_tot_found_ghost
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac _
{ "end_col": 86, "end_line": 372, "start_col": 2, "start_line": 371 }
FStar.Tactics.Effect.Tac
val check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop
val check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) let check_vprop_with_core (g: env) (t: term) : T.Tac (tot_typing g t tm_vprop) =
true
null
false
core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Checker.Pure.core_check_term_with_expected_type", "Pulse.Typing.Env.push_context_no_range", "FStar.Stubs.TypeChecker.Core.E_Total", "Pulse.Syntax.Base.tm_vprop", "Pulse.Typing.typing", "Pulse.Typing.tot_typing" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) =
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop)
[]
Pulse.Checker.Pure.check_vprop_with_core
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Pulse.Typing.tot_typing g t Pulse.Syntax.Base.tm_vprop)
{ "end_col": 74, "end_line": 307, "start_col": 2, "start_line": 306 }
FStar.Tactics.Effect.Tac
val core_check_tot_term (g:env) (t:term) : T.Tac (ty:typ & tot_typing g t ty)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let core_check_tot_term g t = let (| eff, ty, d |) = core_check_term g t in if eff = T.E_Total then (| ty, d |) else fail_expected_tot_found_ghost g t
val core_check_tot_term (g:env) (t:term) : T.Tac (ty:typ & tot_typing g t ty) let core_check_tot_term g t =
true
null
false
let (| eff , ty , d |) = core_check_term g t in if eff = T.E_Total then (| ty, d |) else fail_expected_tot_found_ghost g t
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "Pulse.Typing.typing", "Prims.op_Equality", "FStar.Stubs.TypeChecker.Core.E_Total", "Prims.Mkdtuple2", "Pulse.Syntax.Base.typ", "Pulse.Typing.tot_typing", "Prims.dtuple2", "Prims.bool", "Pulse.Checker.Pure.fail_expected_tot_found_ghost", "FStar.Pervasives.dtuple3", "Pulse.Checker.Pure.core_check_term" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_with_expected_type g e t = check_term_with_expected_type_and_effect g e T.E_Total t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val core_check_tot_term (g:env) (t:term) : T.Tac (ty:typ & tot_typing g t ty)
[]
Pulse.Checker.Pure.core_check_tot_term
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Prims.dtuple2 Pulse.Syntax.Base.typ (fun ty -> Pulse.Typing.tot_typing g t ty))
{ "end_col": 40, "end_line": 390, "start_col": 29, "start_line": 387 }
FStar.Tactics.Effect.Tac
val check_tot_term_and_type (g:env) (t:term) : T.Tac (t:term & u:universe & ty:typ & universe_of g ty u & tot_typing g t ty)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t
val check_tot_term_and_type (g:env) (t:term) : T.Tac (t:term & u:universe & ty:typ & universe_of g ty u & tot_typing g t ty) let check_tot_term_and_type g t =
false
null
false
let (| t , eff , ty , (| u , ty_typing |) , t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "Pulse.Syntax.Base.universe", "Pulse.Typing.universe_of", "Pulse.Typing.typing", "Prims.op_Equality", "FStar.Stubs.TypeChecker.Core.E_Total", "FStar.Pervasives.Mkdtuple5", "Pulse.Syntax.Base.typ", "Pulse.Typing.tot_typing", "FStar.Pervasives.dtuple5", "Prims.bool", "Pulse.Checker.Pure.fail_expected_tot_found_ghost", "Prims.dtuple2", "Pulse.Checker.Pure.check_term_and_type" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_tot_term_and_type (g:env) (t:term) : T.Tac (t:term & u:universe & ty:typ & universe_of g ty u & tot_typing g t ty)
[]
Pulse.Checker.Pure.check_tot_term_and_type
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple5 Pulse.Syntax.Base.term (fun _ -> Pulse.Syntax.Base.universe) (fun _ _ -> Pulse.Syntax.Base.typ) (fun _ u92 ty -> Pulse.Typing.universe_of g ty u92) (fun t _ ty _ -> Pulse.Typing.tot_typing g t ty))
{ "end_col": 40, "end_line": 382, "start_col": 33, "start_line": 379 }
FStar.Tactics.Effect.Tac
val check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop
val check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) let check_vprop (g: env) (t: term) : T.Tac (t: term & tot_typing g t tm_vprop) =
true
null
false
check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Checker.Pure.check_term_with_expected_type_and_effect", "Pulse.Typing.Env.push_context_no_range", "FStar.Stubs.TypeChecker.Core.E_Total", "Pulse.Syntax.Base.tm_vprop", "Prims.dtuple2", "Pulse.Typing.typing", "Pulse.Typing.tot_typing" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term)
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop)
[]
Pulse.Checker.Pure.check_vprop
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Prims.dtuple2 Pulse.Syntax.Base.term (fun t -> Pulse.Typing.tot_typing g t Pulse.Syntax.Base.tm_vprop))
{ "end_col": 103, "end_line": 300, "start_col": 2, "start_line": 300 }
FStar.Tactics.Effect.Tac
val check_tot_term (g:env) (t:term) : T.Tac (t:term & ty:typ & tot_typing g t ty)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t
val check_tot_term (g:env) (t:term) : T.Tac (t:term & ty:typ & tot_typing g t ty) let check_tot_term g t =
true
null
false
let (| t , eff , ty , t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "Pulse.Typing.typing", "Prims.op_Equality", "FStar.Stubs.TypeChecker.Core.E_Total", "FStar.Pervasives.Mkdtuple3", "Pulse.Syntax.Base.typ", "Pulse.Typing.tot_typing", "FStar.Pervasives.dtuple3", "Prims.bool", "Pulse.Checker.Pure.fail_expected_tot_found_ghost", "FStar.Pervasives.dtuple4", "Pulse.Checker.Pure.check_term" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t))
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_tot_term (g:env) (t:term) : T.Tac (t:term & ty:typ & tot_typing g t ty)
[]
Pulse.Checker.Pure.check_tot_term
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple3 Pulse.Syntax.Base.term (fun _ -> Pulse.Syntax.Base.typ) (fun t ty -> Pulse.Typing.tot_typing g t ty))
{ "end_col": 40, "end_line": 377, "start_col": 24, "start_line": 374 }
FStar.Tactics.Effect.Tac
val ill_typed_term (t: term) (expected_typ got_typ: option term) : Tac (list FStar.Stubs.Pprint.document)
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')]
val ill_typed_term (t: term) (expected_typ got_typ: option term) : Tac (list FStar.Stubs.Pprint.document) let ill_typed_term (t: term) (expected_typ got_typ: option term) : Tac (list FStar.Stubs.Pprint.document) =
true
null
false
let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [ group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty') ]
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.Mktuple2", "Prims.Cons", "FStar.Stubs.Pprint.document", "Prims.Nil", "Prims.list", "FStar.Stubs.Pprint.op_Hat_Hat", "Pulse.PP.text", "Pulse.PP.pp", "Pulse.PP.uu___44", "FStar.Stubs.Pprint.op_Hat_Slash_Hat", "FStar.Stubs.Pprint.group" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s)
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val ill_typed_term (t: term) (expected_typ got_typ: option term) : Tac (list FStar.Stubs.Pprint.document)
[]
Pulse.Checker.Pure.ill_typed_term
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
t: Pulse.Syntax.Base.term -> expected_typ: FStar.Pervasives.Native.option Pulse.Syntax.Base.term -> got_typ: FStar.Pervasives.Native.option Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Prims.list FStar.Stubs.Pprint.document)
{ "end_col": 39, "end_line": 126, "start_col": 2, "start_line": 116 }
FStar.Tactics.Effect.Tac
val check_subtyping (g:env) (t1 t2 : term) : T.Tac (subtyping_token g t1 t2)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_subtyping g t1 t2 = T.with_policy SMTSync (fun () -> let res, issues = rtb_check_subtyping g t1 t2 in T.log_issues issues; match res with | Some tok -> tok | None -> fail g (Some t1.range) (Printf.sprintf "Could not prove subtyping of %s and %s" (P.term_to_string t1) (P.term_to_string t2)) )
val check_subtyping (g:env) (t1 t2 : term) : T.Tac (subtyping_token g t1 t2) let check_subtyping g t1 t2 =
true
null
false
T.with_policy SMTSync (fun () -> let res, issues = rtb_check_subtyping g t1 t2 in T.log_issues issues; match res with | Some tok -> tok | None -> fail g (Some t1.range) (Printf.sprintf "Could not prove subtyping of %s and %s" (P.term_to_string t1) (P.term_to_string t2)))
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Tactics.V2.Derived.with_policy", "FStar.Tactics.Types.subtyping_token", "Pulse.Typing.elab_env", "Pulse.Elaborate.Pure.elab_term", "FStar.Tactics.Types.SMTSync", "Prims.unit", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.rtb_check_subtyping", "Pulse.Typing.subtyping_token" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok let fail_expected_tot_found_ghost (g:env) (t:term) = fail g (Some t.range) (Printf.sprintf "Expected a total term, found ghost term %s" (P.term_to_string t)) let check_tot_term g t = let (| t, eff, ty, t_typing |) = check_term g t in if eff = T.E_Total then (| t, ty, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_and_type g t = let (| t, eff, ty, (| u, ty_typing |), t_typing |) = check_term_and_type g t in if eff = T.E_Total then (| t, u, ty, ty_typing, t_typing |) else fail_expected_tot_found_ghost g t let check_tot_term_with_expected_type g e t = check_term_with_expected_type_and_effect g e T.E_Total t let core_check_tot_term g t = let (| eff, ty, d |) = core_check_term g t in if eff = T.E_Total then (| ty, d |) else fail_expected_tot_found_ghost g t let core_check_tot_term_with_expected_type g e t = core_check_term_with_expected_type g e T.E_Total t let is_non_informative g c = let ropt, issues = catch_all (fun _ -> T.is_non_informative (elab_env g) (elab_comp c)) in T.log_issues issues; ropt
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_subtyping (g:env) (t1 t2 : term) : T.Tac (subtyping_token g t1 t2)
[]
Pulse.Checker.Pure.check_subtyping
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t1: Pulse.Syntax.Base.term -> t2: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Pulse.Typing.subtyping_token g t1 t2)
{ "end_col": 3, "end_line": 412, "start_col": 2, "start_line": 401 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss
let rtb_instantiate_implicits g f t =
true
null
false
debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "FStar.Reflection.Types.env", "FStar.Reflection.Types.term", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.tuple2", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.issues", "FStar.Pervasives.Native.Mktuple2", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.term_to_string", "FStar.Tactics.V2.Builtins.instantiate_implicits", "FStar.Tactics.V2.Builtins.ret_t", "Prims.eq2", "Pulse.RuntimeUtils.deep_transform_to_unary_applications" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_instantiate_implicits : g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> t: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Reflection.Types.term * FStar.Reflection.Types.typ) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_instantiate_implicits
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> t: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Reflection.Types.term * FStar.Reflection.Types.typ) * FStar.Tactics.Types.issues)
{ "end_col": 12, "end_line": 71, "start_col": 2, "start_line": 60 }
FStar.Tactics.Effect.Tac
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues
let rtb_check_prop_validity (g: env) (f p: _) =
true
null
false
debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "FStar.Reflection.Types.env", "FStar.Reflection.Types.term", "FStar.Pervasives.Native.option", "FStar.Tactics.V2.Builtins.prop_validity_token", "FStar.Tactics.Types.issues", "FStar.Pervasives.Native.Mktuple2", "FStar.Pervasives.Native.None", "FStar.Pervasives.Native.Some", "Pulse.Checker.Pure.squash_prop_validity_token", "FStar.Pervasives.Native.tuple2", "FStar.Tactics.V2.Builtins.check_prop_validity", "FStar.Tactics.V2.Builtins.ret_t", "Pulse.Checker.Pure.mk_squash", "Prims.unit", "Pulse.Checker.Pure.debug", "Prims.string", "FStar.Printf.sprintf", "FStar.Tactics.V2.Builtins.range_to_string", "Pulse.RuntimeUtils.range_of_term", "FStar.Tactics.V2.Builtins.term_to_string" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val rtb_check_prop_validity : g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> p: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.V2.Builtins.prop_validity_token f p) * FStar.Tactics.Types.issues)
[]
Pulse.Checker.Pure.rtb_check_prop_validity
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: FStar.Reflection.Types.env -> p: FStar.Reflection.Types.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Tactics.V2.Builtins.prop_validity_token f p) * FStar.Tactics.Types.issues)
{ "end_col": 65, "end_line": 99, "start_col": 2, "start_line": 91 }
FStar.Tactics.Effect.Tac
val check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |)
val check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) let check_universe (g: env) (t: term) : T.Tac (u: universe & universe_of g t u) =
true
null
false
let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof:squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof:RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "FStar.Reflection.Types.universe", "FStar.Tactics.Types.typing_token", "FStar.Pervasives.Native.Mktuple2", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Reflection.Types.typ", "FStar.Stubs.TypeChecker.Core.E_Total", "FStar.Reflection.V2.Builtins.pack_ln", "FStar.Reflection.V2.Data.Tv_Type", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail_doc", "Prims.dtuple2", "Pulse.Syntax.Base.universe", "Pulse.Typing.universe_of", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.list", "FStar.Stubs.Pprint.document", "Pulse.Checker.Pure.ill_typed_term", "Pulse.Syntax.Pure.tm_type", "Pulse.Syntax.Pure.u_unknown", "FStar.Pervasives.Native.None", "Prims.Mkdtuple2", "Pulse.Typing.E", "FStar.Reflection.Typing.typing", "Pulse.Typing.elab_env", "Pulse.Elaborate.Pure.elab_term", "FStar.Reflection.Typing.T_Token", "Prims.squash", "FStar.Squash.get_proof", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.catch_all", "Pulse.Checker.Pure.rtb_universe_of", "FStar.Reflection.Types.term", "FStar.Reflection.Types.env" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term)
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u)
[]
Pulse.Checker.Pure.check_universe
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Prims.dtuple2 Pulse.Syntax.Base.universe (fun u45 -> Pulse.Typing.universe_of g t u45))
{ "end_col": 23, "end_line": 166, "start_col": 3, "start_line": 153 }
FStar.Tactics.Effect.Tac
val check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) = let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok
val check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) let check_prop_validity (g: env) (p: term) (_: tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p) =
true
null
false
let t_opt, issues = rtb_check_prop_validity g (elab_env g) (elab_term p) in T.log_issues issues; match t_opt with | None -> fail g (Some p.range) (Printf.sprintf "Failed to prove property: %s\n" (Pulse.Syntax.Printer.term_to_string p)) | Some tok -> tok
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Typing.tm_prop", "FStar.Pervasives.Native.option", "FStar.Tactics.V2.Builtins.prop_validity_token", "Pulse.Typing.elab_env", "Pulse.Elaborate.Pure.elab_term", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail", "Pulse.Typing.prop_validity", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.rtb_check_prop_validity" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t) let check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop)
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_prop_validity (g:env) (p:term) (_:tot_typing g p tm_prop) : T.Tac (Pulse.Typing.prop_validity g p)
[]
Pulse.Checker.Pure.check_prop_validity
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> p: Pulse.Syntax.Base.term -> _: Pulse.Typing.tot_typing g p Pulse.Typing.tm_prop -> FStar.Tactics.Effect.Tac (Pulse.Typing.prop_validity g p)
{ "end_col": 20, "end_line": 368, "start_col": 3, "start_line": 361 }
FStar.Tactics.Effect.Tac
val instantiate_term_implicits (g:env) (t:term) : T.Tac (term & term)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t)
val instantiate_term_implicits (g:env) (t:term) : T.Tac (term & term) let instantiate_term_implicits (g: env) (t0: term) =
true
null
false
let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [prefix 4 1 (text "Could not infer implicit arguments in") (pp t0)] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.tuple2", "FStar.Reflection.Types.term", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail_doc", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.list", "FStar.Stubs.Pprint.document", "Prims.Cons", "Prims.Nil", "FStar.Stubs.Pprint.prefix", "Pulse.PP.text", "Pulse.PP.pp", "Pulse.PP.uu___44", "FStar.Pervasives.Native.Mktuple2", "Prims.eq2", "Pulse.Elaborate.Pure.elab_term", "Pulse.Typing.Env.fail", "Prims.string", "Pulse.Checker.Pure.readback_failure", "Pulse.Readback.readback_ty", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "Pulse.Checker.Pure.catch_all", "Pulse.Checker.Pure.rtb_instantiate_implicits", "FStar.Reflection.Types.env", "Pulse.RuntimeUtils.env_set_range", "FStar.Range.range", "Pulse.Typing.Env.get_range", "Pulse.Typing.elab_env" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')]
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val instantiate_term_implicits (g:env) (t:term) : T.Tac (term & term)
[]
Pulse.Checker.Pure.instantiate_term_implicits
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Pulse.Syntax.Base.term * Pulse.Syntax.Base.term)
{ "end_col": 49, "end_line": 149, "start_col": 50, "start_line": 128 }
FStar.Tactics.Effect.Tac
val get_non_informative_witness (g:env) (u:universe) (t:term) : T.Tac (non_informative_t g u t)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) = let err () = let open Pulse.PP in fail_doc g (Some t.range) [ text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t ] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t)
val get_non_informative_witness (g:env) (u:universe) (t:term) : T.Tac (non_informative_t g u t) let get_non_informative_witness g u t : T.Tac (non_informative_t g u t) =
true
null
false
let err () = let open Pulse.PP in fail_doc g (Some t.range) [text "Expected a term with a non-informative (e.g., erased) type; got" ^/^ pp t] in let eopt = let ropt = is_fvar_app t in match ropt with | Some (l, us, _, arg_opt) -> if l = R.unit_lid then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "unit_non_informative"))) else if l = R.prop_qn then Some (tm_fvar (as_fv (mk_pulse_lib_core_lid "prop_non_informative"))) else if l = R.squash_qn && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "squash_non_informative")) us) None (Some?.v arg_opt)) else if l = erased_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_core_lid "erased_non_informative")) us) None (Some?.v arg_opt)) else if l = gref_lid && Some? arg_opt then Some (tm_pureapp (tm_uinst (as_fv (mk_pulse_lib_gref_lid "gref_non_informative")) us) None (Some?.v arg_opt)) else None | _ -> None in match eopt with | None -> err () | Some e -> check_term_with_expected_type_and_effect (push_context_no_range g "get_noninformative_witness") e T.E_Total (non_informative_witness_t u t)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.universe", "Pulse.Syntax.Base.term", "Pulse.Typing.non_informative_t", "Pulse.Checker.Pure.check_term_with_expected_type_and_effect", "Pulse.Typing.Env.push_context_no_range", "FStar.Stubs.TypeChecker.Core.E_Total", "Pulse.Typing.non_informative_witness_t", "Prims.dtuple2", "Pulse.Typing.typing", "FStar.Pervasives.Native.option", "FStar.Reflection.Types.name", "Prims.list", "Pulse.Syntax.Base.qualifier", "Prims.op_Equality", "Prims.string", "FStar.Reflection.Const.unit_lid", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Pure.tm_fvar", "Pulse.Syntax.Base.as_fv", "Pulse.Reflection.Util.mk_pulse_lib_core_lid", "Prims.bool", "FStar.Reflection.Const.prop_qn", "Prims.op_AmpAmp", "FStar.Reflection.Const.squash_qn", "FStar.Pervasives.Native.uu___is_Some", "Pulse.Syntax.Pure.tm_pureapp", "Pulse.Syntax.Pure.tm_uinst", "FStar.Pervasives.Native.None", "FStar.Pervasives.Native.__proj__Some__item__v", "Pulse.Reflection.Util.erased_lid", "Pulse.Checker.Pure.gref_lid", "Pulse.Checker.Pure.mk_pulse_lib_gref_lid", "FStar.Pervasives.Native.tuple4", "Pulse.Syntax.Pure.is_fvar_app", "Prims.unit", "Pulse.Typing.Env.fail_doc", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "FStar.Stubs.Pprint.document", "Prims.Cons", "Prims.Nil", "FStar.Stubs.Pprint.op_Hat_Slash_Hat", "Pulse.PP.text", "Pulse.PP.pp", "Pulse.PP.uu___44" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |) let check_term_with_expected_type_and_effect (g:env) (e:term) (eff:T.tot_or_ghost) (t:term) : T.Tac (e:term & typing g e eff t) = let e, _ = instantiate_term_implicits g e in let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> (| e, E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) |) (* This function will use the expected type, but can return either a Tot or GTot term. It has an inefficient implementation right now, it will change once we add a new primitive to F* (or refactor the current ones)*) let check_term_with_expected_type (g:env) (e:term) (t:term) : T.Tac (e:term & eff:T.tot_or_ghost & typing g e eff t) = try let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Total t in (| e, T.E_Total, et |) <: (e:term & eff:T.tot_or_ghost & typing g e eff t) with | _ -> let (| e, et |) = check_term_with_expected_type_and_effect g e T.E_Ghost t in (| e, T.E_Ghost, et |) let tc_with_core g (f:R.env) (e:R.term) : T.Tac (option (eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let ropt, issues = catch_all (fun _ -> rtb_core_check_term (push_context g "tc_with_core" (range_of_term e)) f e) in match ropt with | None -> None, issues | Some (eff, t) -> Some (| eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues let core_check_term (g:env) (t:term) : T.Tac (eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_with_core (push_context g "core_check_term" (range_of_term rt)) fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| eff, ty', tok |) -> match readback_ty ty' with | None -> fail g (Some t.range) (readback_failure ty') | Some ty -> (| eff, ty, E tok |) let core_check_term_with_expected_type g e eff t = let fg = elab_env g in let re = elab_term e in let rt = elab_term t in let topt, issues = catch_all (fun _ -> rtb_core_check_term_at_type (push_context g "core_check_term_with_expected_type" (range_of_term rt)) fg re eff rt) in T.log_issues issues; match topt with | None -> fail_doc g (Some e.range) (ill_typed_term e (Some t) None) | Some tok -> E (RT.T_Token _ _ _ (FStar.Squash.return_squash tok)) let check_vprop (g:env) (t:term) : T.Tac (t:term & tot_typing g t tm_vprop) = check_term_with_expected_type_and_effect (push_context_no_range g "check_vprop") t T.E_Total tm_vprop let check_vprop_with_core (g:env) (t:term) : T.Tac (tot_typing g t tm_vprop) = core_check_term_with_expected_type (push_context_no_range g "check_vprop_with_core") t T.E_Total tm_vprop let pulse_lib_gref = ["Pulse"; "Lib"; "GhostReference"] let mk_pulse_lib_gref_lid s = pulse_lib_gref@[s] let gref_lid = mk_pulse_lib_gref_lid "ref" let get_non_informative_witness g u t
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val get_non_informative_witness (g:env) (u:universe) (t:term) : T.Tac (non_informative_t g u t)
[]
Pulse.Checker.Pure.get_non_informative_witness
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> u75: Pulse.Syntax.Base.universe -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (Pulse.Typing.non_informative_t g u75 t)
{ "end_col": 39, "end_line": 357, "start_col": 3, "start_line": 317 }
FStar.Tactics.Effect.Tac
val check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |)
val check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) let check_term (g: env) (t: term) : T.Tac (t: term & eff: T.tot_or_ghost & ty: term & typing g t eff ty) =
true
null
false
let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt , eff , ty' , tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "FStar.Pervasives.dtuple4", "FStar.Reflection.Types.term", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Reflection.Typing.typing", "FStar.Pervasives.Native.Mktuple2", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail_doc", "Pulse.Typing.typing", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.list", "FStar.Stubs.Pprint.document", "Pulse.Checker.Pure.ill_typed_term", "FStar.Pervasives.Native.None", "Prims.eq2", "Pulse.Elaborate.Pure.elab_term", "Pulse.Readback.readback_ty", "Pulse.Typing.Env.fail", "Prims.string", "Pulse.Checker.Pure.readback_failure", "FStar.Pervasives.Mkdtuple4", "Pulse.Typing.E", "Pulse.Typing.elab_env", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.tc_meta_callback", "Pulse.Checker.Pure.debug", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string", "FStar.Tactics.V2.Builtins.term_to_string", "FStar.Reflection.Types.env" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term &
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty)
[]
Pulse.Checker.Pure.check_term
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple4 Pulse.Syntax.Base.term (fun _ -> FStar.Stubs.TypeChecker.Core.tot_or_ghost) (fun _ _ -> Pulse.Syntax.Base.term) (fun t eff ty -> Pulse.Typing.typing g t eff ty))
{ "end_col": 50, "end_line": 200, "start_col": 3, "start_line": 185 }
FStar.Tactics.Effect.Tac
val check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty)
[ { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u, uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |)
val check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty) let check_term_and_type (g: env) (t: term) : T.Tac (t: term & eff: T.tot_or_ghost & ty: term & (u: universe & universe_of g ty u) & typing g t eff ty) =
false
null
false
let fg = elab_env g in let rt = elab_term t in let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt , eff , ty' , tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> let (| u , uty |) = check_universe g ty in (| t, eff, ty, (| u, uty |), E tok |)
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "FStar.Pervasives.dtuple4", "FStar.Reflection.Types.term", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "FStar.Reflection.Typing.typing", "FStar.Pervasives.Native.Mktuple2", "FStar.Reflection.Types.typ", "FStar.Tactics.Types.issues", "Pulse.Typing.Env.fail_doc", "FStar.Pervasives.dtuple5", "Prims.dtuple2", "Pulse.Syntax.Base.universe", "Pulse.Typing.universe_of", "Pulse.Typing.typing", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Prims.list", "FStar.Stubs.Pprint.document", "Pulse.Checker.Pure.ill_typed_term", "FStar.Pervasives.Native.None", "Prims.eq2", "Pulse.Elaborate.Pure.elab_term", "Pulse.Readback.readback_ty", "Pulse.Typing.Env.fail", "Prims.string", "Pulse.Checker.Pure.readback_failure", "FStar.Pervasives.Mkdtuple5", "Prims.Mkdtuple2", "Pulse.Typing.E", "Pulse.Typing.elab_env", "Pulse.Checker.Pure.check_universe", "Prims.unit", "FStar.Tactics.V2.Builtins.log_issues", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.tc_meta_callback", "FStar.Reflection.Types.env" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v let readback_failure (s:R.term) = Printf.sprintf "Internal error: failed to readback F* term %s" (T.term_to_string s) let ill_typed_term (t:term) (expected_typ:option term) (got_typ:option term) : Tac (list FStar.Stubs.Pprint.document) = let open Pulse.PP in match expected_typ, got_typ with | None, _ -> [text "Ill-typed term: " ^^ pp t] | Some ty, None -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t)] | Some ty, Some ty' -> [group (text "Expected term of type" ^/^ pp ty) ^/^ group (text "got term" ^/^ pp t) ^/^ group (text "of type" ^/^ pp ty')] let instantiate_term_implicits (g:env) (t0:term) = let f = elab_env g in let rt = elab_term t0 in let f = RU.env_set_range f (Pulse.Typing.Env.get_range g (Some t0.range)) in let topt, issues = catch_all (fun _ -> rtb_instantiate_implicits g f rt) in T.log_issues issues; match topt with | None -> let open Pulse.PP in fail_doc g (Some t0.range) [ prefix 4 1 (text "Could not infer implicit arguments in") (pp t0) ] | Some (t, ty) -> let topt = readback_ty t in let tyopt = readback_ty ty in match topt, tyopt with | Some t, Some ty -> t, ty | Some _, None -> fail g (Some t0.range) (readback_failure ty) | None, _ -> fail g (Some t0.range) (readback_failure t) let check_universe (g:env) (t:term) : T.Tac (u:universe & universe_of g t u) = let f = elab_env g in let rt = elab_term t in let ru_opt, issues = catch_all (fun _ -> rtb_universe_of g f rt) in T.log_issues issues; match ru_opt with | None -> fail_doc g (Some t.range) (ill_typed_term t (Some (tm_type u_unknown)) None) | Some ru -> let proof : squash (T.typing_token f rt (E_Total, R.pack_ln (R.Tv_Type ru))) = FStar.Squash.get_proof _ in let proof : RT.typing f rt (E_Total, R.pack_ln (R.Tv_Type ru)) = RT.T_Token _ _ _ proof in (| ru, E proof |) let tc_meta_callback g (f:R.env) (e:R.term) : T.Tac (option (e:R.term & eff:T.tot_or_ghost & t:R.term & RT.typing f e (eff, t)) & issues) = let res = match catch_all (fun _ -> rtb_tc_term g f e) with | None, issues -> None, issues | Some (e, (eff, t)), issues -> Some (| e, eff, t, RT.T_Token _ _ _ (FStar.Squash.get_proof _) |), issues in res let check_term (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & typing g t eff ty) = let fg = elab_env g in let rt = elab_term t in debug g (fun _ -> Printf.sprintf "check_tot : called on %s elaborated to %s" (P.term_to_string t) (T.term_to_string rt)); let res, issues = tc_meta_callback g fg rt in T.log_issues issues; match res with | None -> fail_doc g (Some t.range) (ill_typed_term t None None) | Some (| rt, eff, ty', tok |) -> match readback_ty rt, readback_ty ty' with | None, _ -> fail g (Some t.range) (readback_failure rt) | _, None -> fail g (Some t.range) (readback_failure ty') | Some t, Some ty -> (| t, eff, ty, E tok |) let check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) &
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check_term_and_type (g:env) (t:term) : T.Tac (t:term & eff:T.tot_or_ghost & ty:term & (u:universe & universe_of g ty u) & typing g t eff ty)
[]
Pulse.Checker.Pure.check_term_and_type
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple5 Pulse.Syntax.Base.term (fun _ -> FStar.Stubs.TypeChecker.Core.tot_or_ghost) (fun _ _ -> Pulse.Syntax.Base.term) (fun _ _ ty -> Prims.dtuple2 Pulse.Syntax.Base.universe (fun u58 -> Pulse.Typing.universe_of g ty u58)) (fun t eff ty _ -> Pulse.Typing.typing g t eff ty))
{ "end_col": 45, "end_line": 222, "start_col": 3, "start_line": 209 }
FStar.Tactics.Effect.Tac
val catch_all (f: (unit -> Tac (option 'a & issues))) : Tac (option 'a & issues)
[ { "abbrev": false, "full_module": "FStar.Reflection.V2 (* shadow named view *)", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.V2.Builtins", "short_module": "RTB" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection", "short_module": null }, { "abbrev": false, "full_module": "FStar.Reflection.V2", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.V2", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "FStar.Tactics.Builtins", "short_module": "RTB" }, { "abbrev": false, "full_module": "Pulse.Readback", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let catch_all (f:unit -> Tac (option 'a & issues)) : Tac (option 'a & issues) = match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v
val catch_all (f: (unit -> Tac (option 'a & issues))) : Tac (option 'a & issues) let catch_all (f: (unit -> Tac (option 'a & issues))) : Tac (option 'a & issues) =
true
null
false
match T.catch f with | Inl exn -> None, [exn_as_issue exn] | Inr v -> v
{ "checked_file": "Pulse.Checker.Pure.fst.checked", "dependencies": [ "Pulse.Typing.Util.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.PP.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.Builtins.fsti.checked", "FStar.Tactics.V2.fst.checked", "FStar.Stubs.Pprint.fsti.checked", "FStar.Squash.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked", "FStar.Issue.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Pure.fst" }
[]
[ "Prims.unit", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.option", "FStar.Tactics.Types.issues", "Prims.exn", "FStar.Pervasives.Native.Mktuple2", "FStar.Pervasives.Native.None", "Prims.Cons", "FStar.Issue.issue", "Pulse.Checker.Pure.exn_as_issue", "Prims.Nil", "FStar.Pervasives.either", "FStar.Tactics.V2.Builtins.catch" ]
[]
module Pulse.Checker.Pure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.Tactics.V2 open FStar.Reflection.V2 (* shadow named view *) open Pulse.Reflection open FStar.List.Tot open Pulse.Syntax open Pulse.Reflection.Util open Pulse.Typing module P = Pulse.Syntax.Printer module RTB = FStar.Tactics.V2.Builtins module RU = Pulse.RuntimeUtils let debug (g:env) (msg: unit -> T.Tac string) = let tac_debugging = T.debugging () in if tac_debugging || RU.debug_at_level (fstar_env g) "refl_tc_callbacks" then T.print (print_context g ^ "\n" ^ msg()) let rtb_core_check_term g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.core_compute_term_type f e in res let rtb_tc_term g f e = (* WARN: unary dependence, see comment in RU *) let e = RU.deep_transform_to_unary_applications e in debug g (fun _ -> Printf.sprintf "(%s) Calling tc_term on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.tc_term f e in res let rtb_universe_of g f e = debug g (fun _ -> Printf.sprintf "(%s) Calling universe_of on %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e)); let res = RTB.universe_of f e in res let rtb_check_subtyping g (t1 t2:term) = debug g (fun _ -> Printf.sprintf "(%s, %s) Calling check_subtyping on %s <: %s" (T.range_to_string (t1.range)) (T.range_to_string (t2.range)) (P.term_to_string t1) (P.term_to_string t2)); let res = RTB.check_subtyping (elab_env g) (elab_term t1) (elab_term t2) in res let rtb_instantiate_implicits g f t = debug g (fun _ -> Printf.sprintf "Calling instantiate_implicits on %s" (T.term_to_string t)); (* WARN: unary dependence, see comment in RU *) let t = RU.deep_transform_to_unary_applications t in let res, iss = RTB.instantiate_implicits f t in match res with | None -> debug g (fun _ -> "Returned from instantiate_implicits: None"); res, iss | Some (t, _) -> debug g (fun _ -> Printf.sprintf "Returned from instantiate_implicits: %s" (T.term_to_string t)); res, iss let rtb_core_check_term_at_type g f e eff t = debug g (fun _ -> Printf.sprintf "(%s) Calling core_check_term on %s and %s" (T.range_to_string (RU.range_of_term e)) (T.term_to_string e) (T.term_to_string t)); let res = RTB.core_check_term f e t eff in res let mk_squash t = let sq : R.term = pack_ln (Tv_UInst (pack_fv squash_qn) [u_zero]) in mk_e_app sq [t] let squash_prop_validity_token f p (t:prop_validity_token f (mk_squash p)) : prop_validity_token f p = admit(); t let rtb_check_prop_validity (g:env) (f:_) (p:_) = debug g (fun _ -> Printf.sprintf "(%s) Calling check_prop_validity on %s" (T.range_to_string (RU.range_of_term p)) (T.term_to_string p)); let sp = mk_squash p in let res, issues = RTB.check_prop_validity f sp in match res with | None -> None, issues | Some tok -> Some (squash_prop_validity_token f p tok), issues let exn_as_issue (e:exn) : FStar.Issue.issue = FStar.Issue.mk_issue "Error" (RU.print_exn e) None None [] let catch_all (f:unit -> Tac (option 'a & issues))
false
false
Pulse.Checker.Pure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val catch_all (f: (unit -> Tac (option 'a & issues))) : Tac (option 'a & issues)
[]
Pulse.Checker.Pure.catch_all
{ "file_name": "lib/steel/pulse/Pulse.Checker.Pure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
f: (_: Prims.unit -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option 'a * FStar.Tactics.Types.issues)) -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option 'a * FStar.Tactics.Types.issues)
{ "end_col": 16, "end_line": 109, "start_col": 4, "start_line": 106 }
FStar.Tactics.Effect.Tac
val debug_log (g: env) (f: (unit -> T.Tac unit)) : T.Tac unit
[ { "abbrev": true, "full_module": "Pulse.Checker.Prover", "short_module": "Prover" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "Pulse.Typing.FV", "short_module": "FV" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let debug_log (g:env) (f:unit -> T.Tac unit) : T.Tac unit = if RU.debug_at_level (fstar_env g) "st_app" then f () else ()
val debug_log (g: env) (f: (unit -> T.Tac unit)) : T.Tac unit let debug_log (g: env) (f: (unit -> T.Tac unit)) : T.Tac unit =
true
null
false
if RU.debug_at_level (fstar_env g) "st_app" then f ()
{ "checked_file": "Pulse.Checker.STApp.fst.checked", "dependencies": [ "Pulse.Typing.FV.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Squash.fsti.checked", "FStar.Set.fsti.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.STApp.fst" }
[]
[ "Pulse.Typing.Env.env", "Prims.unit", "Pulse.RuntimeUtils.debug_at_level", "Pulse.Typing.Env.fstar_env", "Prims.bool" ]
[]
module Pulse.Checker.STApp open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base module T = FStar.Tactics.V2 module RT = FStar.Reflection.Typing module FV = Pulse.Typing.FV module RU = Pulse.RuntimeUtils module P = Pulse.Syntax.Printer module Prover = Pulse.Checker.Prover
false
false
Pulse.Checker.STApp.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val debug_log (g: env) (f: (unit -> T.Tac unit)) : T.Tac unit
[]
Pulse.Checker.STApp.debug_log
{ "file_name": "lib/steel/pulse/Pulse.Checker.STApp.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> f: (_: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit) -> FStar.Tactics.Effect.Tac Prims.unit
{ "end_col": 121, "end_line": 15, "start_col": 60, "start_line": 15 }
Prims.Tot
val canon_comp (c: comp_st) : comp_st
[ { "abbrev": true, "full_module": "Pulse.Checker.Prover", "short_module": "Prover" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "Pulse.Typing.FV", "short_module": "FV" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let canon_comp (c:comp_st) : comp_st = match readback_comp (elab_comp c) with | None -> c | Some (C_Tot _) -> c //should be impossible | Some c' -> c'
val canon_comp (c: comp_st) : comp_st let canon_comp (c: comp_st) : comp_st =
false
null
false
match readback_comp (elab_comp c) with | None -> c | Some (C_Tot _) -> c | Some c' -> c'
{ "checked_file": "Pulse.Checker.STApp.fst.checked", "dependencies": [ "Pulse.Typing.FV.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Squash.fsti.checked", "FStar.Set.fsti.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.STApp.fst" }
[ "total" ]
[ "Pulse.Syntax.Base.comp_st", "Pulse.Readback.readback_comp", "Pulse.Elaborate.Pure.elab_comp", "Pulse.Syntax.Base.term", "Pulse.Syntax.Base.comp", "Prims.eq2", "FStar.Reflection.Types.term" ]
[]
module Pulse.Checker.STApp open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base module T = FStar.Tactics.V2 module RT = FStar.Reflection.Typing module FV = Pulse.Typing.FV module RU = Pulse.RuntimeUtils module P = Pulse.Syntax.Printer module Prover = Pulse.Checker.Prover let debug_log (g:env) (f:unit -> T.Tac unit) : T.Tac unit = if RU.debug_at_level (fstar_env g) "st_app" then f () else ()
false
true
Pulse.Checker.STApp.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val canon_comp (c: comp_st) : comp_st
[]
Pulse.Checker.STApp.canon_comp
{ "file_name": "lib/steel/pulse/Pulse.Checker.STApp.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
c: Pulse.Syntax.Base.comp_st -> Pulse.Syntax.Base.comp_st
{ "end_col": 17, "end_line": 21, "start_col": 2, "start_line": 18 }
Prims.Tot
val coerce_eq: #a: Type -> #b: Type -> x: a -> squash (a === b) -> y: b{y == x}
[ { "abbrev": true, "full_module": "Pulse.Checker.Prover", "short_module": "Prover" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "Pulse.Typing.FV", "short_module": "FV" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let coerce_eq (#a #b:Type) (x:a) (_:squash (a === b)) : y:b { y == x } = x
val coerce_eq: #a: Type -> #b: Type -> x: a -> squash (a === b) -> y: b{y == x} let coerce_eq (#a: Type) (#b: Type) (x: a) (_: squash (a === b)) : y: b{y == x} =
false
null
false
x
{ "checked_file": "Pulse.Checker.STApp.fst.checked", "dependencies": [ "Pulse.Typing.FV.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Squash.fsti.checked", "FStar.Set.fsti.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.STApp.fst" }
[ "total" ]
[ "Prims.squash", "Prims.op_Equals_Equals_Equals", "Prims.eq2" ]
[]
module Pulse.Checker.STApp open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base module T = FStar.Tactics.V2 module RT = FStar.Reflection.Typing module FV = Pulse.Typing.FV module RU = Pulse.RuntimeUtils module P = Pulse.Syntax.Printer module Prover = Pulse.Checker.Prover let debug_log (g:env) (f:unit -> T.Tac unit) : T.Tac unit = if RU.debug_at_level (fstar_env g) "st_app" then f () else () let canon_comp (c:comp_st) : comp_st = match readback_comp (elab_comp c) with | None -> c | Some (C_Tot _) -> c //should be impossible | Some c' -> c' #push-options "--admit_smt_queries true" let canon_comp_eq_res (g:env) (c:comp_st) : RT.equiv (elab_env g) (elab_term (comp_res c)) (elab_term (comp_res (canon_comp c))) = RT.Rel_refl _ _ _ #pop-options let canonicalize_st_typing (#g:env) (#t:st_term) (#c:comp_st) (d:st_typing g t c) : st_typing g t (canon_comp c) = let c' = canon_comp c in let x = fresh g in assume ( ~(x `Set.mem` freevars (comp_post c)) /\ ~(x `Set.mem` freevars (comp_post c')) ); assume (st_equiv_pre c c'); let st_eq : st_equiv g c c' = ST_VPropEquiv g c c' x (magic ()) (magic()) (magic()) (canon_comp_eq_res g c) (magic()) (magic()) in T_Equiv _ _ _ _ d st_eq
false
false
Pulse.Checker.STApp.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val coerce_eq: #a: Type -> #b: Type -> x: a -> squash (a === b) -> y: b{y == x}
[]
Pulse.Checker.STApp.coerce_eq
{ "file_name": "lib/steel/pulse/Pulse.Checker.STApp.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
x: a -> _: Prims.squash (a === b) -> y: b{y == x}
{ "end_col": 74, "end_line": 42, "start_col": 73, "start_line": 42 }
FStar.Tactics.Effect.Tac
val instantiate_implicits (g: env) (t: st_term{Tm_STApp? t.term}) : T.Tac (uvs: env & g': env{extends_with g' g uvs} & t': st_term{Tm_STApp? t'.term})
[ { "abbrev": true, "full_module": "Pulse.Checker.Prover", "short_module": "Prover" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "Pulse.Typing.FV", "short_module": "FV" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let instantiate_implicits (g:env) (t:st_term { Tm_STApp? t.term }) : T.Tac (uvs : env & g' : env { extends_with g' g uvs } & t' : st_term { Tm_STApp? t'.term }) = let range = t.range in let Tm_STApp { head; arg_qual=qual; arg } = t.term in let pure_app = tm_pureapp head qual arg in let t, ty = instantiate_term_implicits g pure_app in match is_arrow ty with | Some (_, Some Implicit, _) -> //Some implicits to follow intro_uvars_for_logical_implicits g (mk_env (fstar_env g)) t ty | _ -> match is_pure_app t with | Some (head, q, arg) -> let uvs = mk_env (fstar_env g) in (| uvs, push_env g uvs, {term=Tm_STApp {head;arg_qual=q;arg}; range=t.range; effect_tag=default_effect_hint } |) | _ -> fail g (Some t.range) (Printf.sprintf "check_stapp.instantiate_implicits: expected an application term, found: %s" (P.term_to_string t))
val instantiate_implicits (g: env) (t: st_term{Tm_STApp? t.term}) : T.Tac (uvs: env & g': env{extends_with g' g uvs} & t': st_term{Tm_STApp? t'.term}) let instantiate_implicits (g: env) (t: st_term{Tm_STApp? t.term}) : T.Tac (uvs: env & g': env{extends_with g' g uvs} & t': st_term{Tm_STApp? t'.term}) =
true
null
false
let range = t.range in let Tm_STApp { head = head ; arg_qual = qual ; arg = arg } = t.term in let pure_app = tm_pureapp head qual arg in let t, ty = instantiate_term_implicits g pure_app in match is_arrow ty with | Some (_, Some Implicit, _) -> intro_uvars_for_logical_implicits g (mk_env (fstar_env g)) t ty | _ -> match is_pure_app t with | Some (head, q, arg) -> let uvs = mk_env (fstar_env g) in (| uvs, push_env g uvs, { term = Tm_STApp ({ head = head; arg_qual = q; arg = arg }); range = t.range; effect_tag = default_effect_hint } |) | _ -> fail g (Some t.range) (Printf.sprintf "check_stapp.instantiate_implicits: expected an application term, found: %s" (P.term_to_string t))
{ "checked_file": "Pulse.Checker.STApp.fst.checked", "dependencies": [ "Pulse.Typing.FV.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Squash.fsti.checked", "FStar.Set.fsti.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.STApp.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.st_term", "Prims.b2t", "Pulse.Syntax.Base.uu___is_Tm_STApp", "Pulse.Syntax.Base.__proj__Mkst_term__item__term", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "Pulse.Syntax.Base.qualifier", "Pulse.Syntax.Pure.is_arrow", "Pulse.Syntax.Base.binder", "Pulse.Syntax.Base.comp", "Pulse.Checker.STApp.intro_uvars_for_logical_implicits", "Pulse.Typing.Env.mk_env", "Pulse.Typing.Env.fstar_env", "FStar.Pervasives.dtuple3", "Pulse.Typing.Env.extends_with", "FStar.Pervasives.Native.tuple3", "Pulse.Syntax.Pure.is_pure_app", "FStar.Pervasives.Mkdtuple3", "Pulse.Typing.Env.push_env", "Pulse.Syntax.Base.Mkst_term", "Pulse.Syntax.Base.Tm_STApp", "Pulse.Syntax.Base.Mkst_term'__Tm_STApp__payload", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Pulse.Syntax.Base.default_effect_hint", "Prims.eq2", "FStar.Reflection.Typing.fstar_top_env", "Pulse.Typing.Env.fail", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string", "FStar.Pervasives.Native.tuple2", "Pulse.Checker.Pure.instantiate_term_implicits", "Pulse.Syntax.Pure.tm_pureapp", "Pulse.Syntax.Base.st_term'", "Pulse.Syntax.Base.__proj__Mkst_term__item__range" ]
[]
module Pulse.Checker.STApp open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base module T = FStar.Tactics.V2 module RT = FStar.Reflection.Typing module FV = Pulse.Typing.FV module RU = Pulse.RuntimeUtils module P = Pulse.Syntax.Printer module Prover = Pulse.Checker.Prover let debug_log (g:env) (f:unit -> T.Tac unit) : T.Tac unit = if RU.debug_at_level (fstar_env g) "st_app" then f () else () let canon_comp (c:comp_st) : comp_st = match readback_comp (elab_comp c) with | None -> c | Some (C_Tot _) -> c //should be impossible | Some c' -> c' #push-options "--admit_smt_queries true" let canon_comp_eq_res (g:env) (c:comp_st) : RT.equiv (elab_env g) (elab_term (comp_res c)) (elab_term (comp_res (canon_comp c))) = RT.Rel_refl _ _ _ #pop-options let canonicalize_st_typing (#g:env) (#t:st_term) (#c:comp_st) (d:st_typing g t c) : st_typing g t (canon_comp c) = let c' = canon_comp c in let x = fresh g in assume ( ~(x `Set.mem` freevars (comp_post c)) /\ ~(x `Set.mem` freevars (comp_post c')) ); assume (st_equiv_pre c c'); let st_eq : st_equiv g c c' = ST_VPropEquiv g c c' x (magic ()) (magic()) (magic()) (canon_comp_eq_res g c) (magic()) (magic()) in T_Equiv _ _ _ _ d st_eq let coerce_eq (#a #b:Type) (x:a) (_:squash (a === b)) : y:b { y == x } = x let rec intro_uvars_for_logical_implicits (g:env) (uvs:env { disjoint uvs g }) (t:term) (ty:term) : T.Tac (uvs':env & g':env { extends_with g' g uvs' } & t':st_term { Tm_STApp? t'.term }) = let ropt = is_arrow ty in match ropt with | Some (b, Some Implicit, c_rest) -> let x = fresh (push_env g uvs) in let uvs' = push_binding uvs x ppname_default b.binder_ty in begin match c_rest with | C_ST _ | C_STAtomic _ _ | C_STGhost _ _ -> (| uvs', push_env g uvs', {term=Tm_STApp {head=t;arg_qual=Some Implicit;arg=null_var x}; range=t.range; effect_tag=as_effect_hint (ctag_of_comp_st c_rest) } |) | C_Tot ty -> intro_uvars_for_logical_implicits g uvs' (tm_pureapp t (Some Implicit) (null_var x)) ty end | _ -> fail g None (Printf.sprintf "check_stapp.intro_uvars_for_logical_implicits: expected an arrow type,\ with an implicit parameter, found: %s" (P.term_to_string ty)) let instantiate_implicits (g:env) (t:st_term { Tm_STApp? t.term }) : T.Tac (uvs : env &
false
false
Pulse.Checker.STApp.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val instantiate_implicits (g: env) (t: st_term{Tm_STApp? t.term}) : T.Tac (uvs: env & g': env{extends_with g' g uvs} & t': st_term{Tm_STApp? t'.term})
[]
Pulse.Checker.STApp.instantiate_implicits
{ "file_name": "lib/steel/pulse/Pulse.Checker.STApp.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> t: Pulse.Syntax.Base.st_term{Tm_STApp? (Mkst_term?.term t)} -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple3 Pulse.Typing.Env.env (fun uvs -> g': Pulse.Typing.Env.env{Pulse.Typing.Env.extends_with g' g uvs}) (fun _ _ -> t': Pulse.Syntax.Base.st_term{Tm_STApp? (Mkst_term?.term t')}))
{ "end_col": 32, "end_line": 93, "start_col": 48, "start_line": 75 }
FStar.Tactics.Effect.Tac
val intro_uvars_for_logical_implicits (g: env) (uvs: env{disjoint uvs g}) (t ty: term) : T.Tac (uvs': env & g': env{extends_with g' g uvs'} & t': st_term{Tm_STApp? t'.term})
[ { "abbrev": true, "full_module": "Pulse.Checker.Prover", "short_module": "Prover" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "Pulse.Typing.FV", "short_module": "FV" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec intro_uvars_for_logical_implicits (g:env) (uvs:env { disjoint uvs g }) (t:term) (ty:term) : T.Tac (uvs':env & g':env { extends_with g' g uvs' } & t':st_term { Tm_STApp? t'.term }) = let ropt = is_arrow ty in match ropt with | Some (b, Some Implicit, c_rest) -> let x = fresh (push_env g uvs) in let uvs' = push_binding uvs x ppname_default b.binder_ty in begin match c_rest with | C_ST _ | C_STAtomic _ _ | C_STGhost _ _ -> (| uvs', push_env g uvs', {term=Tm_STApp {head=t;arg_qual=Some Implicit;arg=null_var x}; range=t.range; effect_tag=as_effect_hint (ctag_of_comp_st c_rest) } |) | C_Tot ty -> intro_uvars_for_logical_implicits g uvs' (tm_pureapp t (Some Implicit) (null_var x)) ty end | _ -> fail g None (Printf.sprintf "check_stapp.intro_uvars_for_logical_implicits: expected an arrow type,\ with an implicit parameter, found: %s" (P.term_to_string ty))
val intro_uvars_for_logical_implicits (g: env) (uvs: env{disjoint uvs g}) (t ty: term) : T.Tac (uvs': env & g': env{extends_with g' g uvs'} & t': st_term{Tm_STApp? t'.term}) let rec intro_uvars_for_logical_implicits (g: env) (uvs: env{disjoint uvs g}) (t ty: term) : T.Tac (uvs': env & g': env{extends_with g' g uvs'} & t': st_term{Tm_STApp? t'.term}) =
true
null
false
let ropt = is_arrow ty in match ropt with | Some (b, Some Implicit, c_rest) -> let x = fresh (push_env g uvs) in let uvs' = push_binding uvs x ppname_default b.binder_ty in (match c_rest with | C_ST _ | C_STAtomic _ _ | C_STGhost _ _ -> (| uvs', push_env g uvs', { term = Tm_STApp ({ head = t; arg_qual = Some Implicit; arg = null_var x }); range = t.range; effect_tag = as_effect_hint (ctag_of_comp_st c_rest) } |) | C_Tot ty -> intro_uvars_for_logical_implicits g uvs' (tm_pureapp t (Some Implicit) (null_var x)) ty) | _ -> fail g None (Printf.sprintf "check_stapp.intro_uvars_for_logical_implicits: expected an arrow type,with an implicit parameter, found: %s" (P.term_to_string ty))
{ "checked_file": "Pulse.Checker.STApp.fst.checked", "dependencies": [ "Pulse.Typing.FV.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Squash.fsti.checked", "FStar.Set.fsti.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.STApp.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Typing.Env.disjoint", "Pulse.Syntax.Base.term", "Pulse.Syntax.Base.binder", "Pulse.Syntax.Base.comp", "Pulse.Syntax.Base.st_comp", "FStar.Pervasives.Mkdtuple3", "Pulse.Typing.Env.extends_with", "Pulse.Syntax.Base.st_term", "Prims.b2t", "Pulse.Syntax.Base.uu___is_Tm_STApp", "Pulse.Syntax.Base.__proj__Mkst_term__item__term", "Pulse.Typing.Env.push_env", "Pulse.Syntax.Base.Mkst_term", "Pulse.Syntax.Base.Tm_STApp", "Pulse.Syntax.Base.Mkst_term'__Tm_STApp__payload", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.qualifier", "Pulse.Syntax.Base.Implicit", "Pulse.Syntax.Pure.null_var", "Pulse.Syntax.Base.__proj__Mkterm__item__range", "Pulse.Syntax.Base.as_effect_hint", "Pulse.Syntax.Base.ctag_of_comp_st", "FStar.Pervasives.dtuple3", "Pulse.Checker.STApp.intro_uvars_for_logical_implicits", "Pulse.Syntax.Pure.tm_pureapp", "Prims.eq2", "FStar.Reflection.Typing.fstar_top_env", "Pulse.Typing.Env.fstar_env", "Pulse.Typing.Env.push_binding", "Pulse.Syntax.Base.ppname_default", "Pulse.Syntax.Base.__proj__Mkbinder__item__binder_ty", "Pulse.Syntax.Base.var", "Prims.l_not", "FStar.Set.mem", "Pulse.Typing.Env.dom", "Pulse.Typing.Env.fresh", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.tuple3", "Pulse.Typing.Env.fail", "FStar.Pervasives.Native.None", "Pulse.Syntax.Base.range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.term_to_string", "Pulse.Syntax.Pure.is_arrow" ]
[]
module Pulse.Checker.STApp open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base module T = FStar.Tactics.V2 module RT = FStar.Reflection.Typing module FV = Pulse.Typing.FV module RU = Pulse.RuntimeUtils module P = Pulse.Syntax.Printer module Prover = Pulse.Checker.Prover let debug_log (g:env) (f:unit -> T.Tac unit) : T.Tac unit = if RU.debug_at_level (fstar_env g) "st_app" then f () else () let canon_comp (c:comp_st) : comp_st = match readback_comp (elab_comp c) with | None -> c | Some (C_Tot _) -> c //should be impossible | Some c' -> c' #push-options "--admit_smt_queries true" let canon_comp_eq_res (g:env) (c:comp_st) : RT.equiv (elab_env g) (elab_term (comp_res c)) (elab_term (comp_res (canon_comp c))) = RT.Rel_refl _ _ _ #pop-options let canonicalize_st_typing (#g:env) (#t:st_term) (#c:comp_st) (d:st_typing g t c) : st_typing g t (canon_comp c) = let c' = canon_comp c in let x = fresh g in assume ( ~(x `Set.mem` freevars (comp_post c)) /\ ~(x `Set.mem` freevars (comp_post c')) ); assume (st_equiv_pre c c'); let st_eq : st_equiv g c c' = ST_VPropEquiv g c c' x (magic ()) (magic()) (magic()) (canon_comp_eq_res g c) (magic()) (magic()) in T_Equiv _ _ _ _ d st_eq let coerce_eq (#a #b:Type) (x:a) (_:squash (a === b)) : y:b { y == x } = x let rec intro_uvars_for_logical_implicits (g:env) (uvs:env { disjoint uvs g }) (t:term) (ty:term) : T.Tac (uvs':env &
false
false
Pulse.Checker.STApp.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val intro_uvars_for_logical_implicits (g: env) (uvs: env{disjoint uvs g}) (t ty: term) : T.Tac (uvs': env & g': env{extends_with g' g uvs'} & t': st_term{Tm_STApp? t'.term})
[ "recursion" ]
Pulse.Checker.STApp.intro_uvars_for_logical_implicits
{ "file_name": "lib/steel/pulse/Pulse.Checker.STApp.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> uvs: Pulse.Typing.Env.env{Pulse.Typing.Env.disjoint uvs g} -> t: Pulse.Syntax.Base.term -> ty: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple3 Pulse.Typing.Env.env (fun uvs' -> g': Pulse.Typing.Env.env{Pulse.Typing.Env.extends_with g' g uvs'}) (fun _ _ -> t': Pulse.Syntax.Base.st_term{Tm_STApp? (Mkst_term?.term t')}))
{ "end_col": 31, "end_line": 69, "start_col": 46, "start_line": 47 }
FStar.Tactics.Effect.Tac
val check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term{Tm_STApp? t.term}) : T.Tac (checker_result_t g pre post_hint)
[ { "abbrev": true, "full_module": "Pulse.Checker.Prover", "short_module": "Prover" }, { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": true, "full_module": "Pulse.Typing.FV", "short_module": "FV" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let check (g0:env) (ctxt:vprop) (ctxt_typing:tot_typing g0 ctxt tm_vprop) (post_hint:post_hint_opt g0) (res_ppname:ppname) (t:st_term { Tm_STApp? t.term }) : T.Tac (checker_result_t g0 ctxt post_hint) = let g0 = push_context "st_app" t.range g0 in let range = t.range in let (| uvs, g, t |) = instantiate_implicits g0 t in assert (g `env_extends` g0); let post_hint : post_hint_opt g = post_hint in let Tm_STApp { head; arg_qual=qual; arg } = t.term in let (| head, eff_head, ty_head, dhead |) = check_term g head in debug_log g (fun _ -> T.print (Printf.sprintf "st_app: head = %s, eff_head: %s, ty_head = %s\n" (P.term_to_string head) (P.tot_or_ghost_to_string eff_head) (P.term_to_string ty_head))); match is_arrow ty_head with | Some ({binder_ty=formal;binder_ppname=ppname}, bqual, comp_typ) -> is_arrow_tm_arrow ty_head; debug_log g (fun _ -> T.print (Printf.sprintf "st_app, readback comp as %s\n" (P.comp_to_string comp_typ))); let allow_ghost = C_STGhost? comp_typ in if (not allow_ghost) && eff_head = T.E_Ghost then fail g (Some t.range) (Printf.sprintf "head term %s is ghost, but the arrow comp is not STGhost" (P.term_to_string head)); if qual = bqual then let eff_arg = if allow_ghost then T.E_Ghost else T.E_Total in let (| arg, darg |) = check_term_with_expected_type_and_effect g arg eff_arg formal in let (| t, c, d |) : (t:st_term & c:comp_st & st_typing g t c) = match comp_typ with | C_ST res | C_STAtomic _ res -> // ST application let d : st_typing _ _ (open_comp_with comp_typ arg) = T_STApp g head formal qual comp_typ arg dhead darg in let d = canonicalize_st_typing d in let t = { term = Tm_STApp {head; arg_qual=qual; arg}; range; effect_tag=as_effect_hint (ctag_of_comp_st comp_typ) } in let c = (canon_comp (open_comp_with comp_typ arg)) in (| t, c, d |) | C_STGhost _ res -> // get the non-informative witness let x = fresh g in if x `Set.mem` freevars_comp (comp_typ) then fail g (Some t.range) ("Unexpected clash of variable names, please file a bug-report"); // // This will always succeed, is there a way to avoid this? // let d_non_info = let token = is_non_informative (push_binding g x ppname_default formal) (open_comp_with comp_typ (null_var x)) in match token with | None -> fail g (Some t.range) (Printf.sprintf "Unexpected non-informative result for %s" (P.comp_to_string comp_typ)) | Some token -> RT.Non_informative_token _ _ (FStar.Squash.return_squash token) in let d : st_typing _ _ (open_comp_with comp_typ arg) = T_STGhostApp g head formal qual comp_typ arg x (lift_typing_to_ghost_typing dhead) (E d_non_info) (lift_typing_to_ghost_typing darg) in let d = canonicalize_st_typing d in let t = { term = Tm_STApp {head; arg_qual=qual; arg}; range; effect_tag=as_effect_hint STT_Ghost } in let c = (canon_comp (open_comp_with comp_typ arg)) in (| t, c, d |) | _ -> fail g (Some t.range) "Expected an effectful application; got a pure term (could it be partially applied by mistake?)" in Prover.prove_post_hint (Prover.try_frame_pre_uvs ctxt_typing uvs (match_comp_res_with_post_hint d post_hint) res_ppname) post_hint t.range else fail g (Some t.range) (Printf.sprintf "Unexpected qualifier in head type %s of stateful application: head = %s, arg = %s" (P.term_to_string ty_head) (P.term_to_string head) (P.term_to_string arg)) | _ -> fail g (Some t.range) (Printf.sprintf "Unexpected head type in impure application: %s" (P.term_to_string ty_head))
val check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term{Tm_STApp? t.term}) : T.Tac (checker_result_t g pre post_hint) let check (g0: env) (ctxt: vprop) (ctxt_typing: tot_typing g0 ctxt tm_vprop) (post_hint: post_hint_opt g0) (res_ppname: ppname) (t: st_term{Tm_STApp? t.term}) : T.Tac (checker_result_t g0 ctxt post_hint) =
true
null
false
let g0 = push_context "st_app" t.range g0 in let range = t.range in let (| uvs , g , t |) = instantiate_implicits g0 t in assert (g `env_extends` g0); let post_hint:post_hint_opt g = post_hint in let Tm_STApp { head = head ; arg_qual = qual ; arg = arg } = t.term in let (| head , eff_head , ty_head , dhead |) = check_term g head in debug_log g (fun _ -> T.print (Printf.sprintf "st_app: head = %s, eff_head: %s, ty_head = %s\n" (P.term_to_string head) (P.tot_or_ghost_to_string eff_head) (P.term_to_string ty_head))); match is_arrow ty_head with | Some ({ binder_ty = formal ; binder_ppname = ppname }, bqual, comp_typ) -> is_arrow_tm_arrow ty_head; debug_log g (fun _ -> T.print (Printf.sprintf "st_app, readback comp as %s\n" (P.comp_to_string comp_typ))); let allow_ghost = C_STGhost? comp_typ in if (not allow_ghost) && eff_head = T.E_Ghost then fail g (Some t.range) (Printf.sprintf "head term %s is ghost, but the arrow comp is not STGhost" (P.term_to_string head)); if qual = bqual then let eff_arg = if allow_ghost then T.E_Ghost else T.E_Total in let (| arg , darg |) = check_term_with_expected_type_and_effect g arg eff_arg formal in let (| t , c , d |):(t: st_term & c: comp_st & st_typing g t c) = match comp_typ with | C_ST res | C_STAtomic _ res -> let d:st_typing _ _ (open_comp_with comp_typ arg) = T_STApp g head formal qual comp_typ arg dhead darg in let d = canonicalize_st_typing d in let t = { term = Tm_STApp ({ head = head; arg_qual = qual; arg = arg }); range = range; effect_tag = as_effect_hint (ctag_of_comp_st comp_typ) } in let c = (canon_comp (open_comp_with comp_typ arg)) in (| t, c, d |) | C_STGhost _ res -> let x = fresh g in if x `Set.mem` (freevars_comp (comp_typ)) then fail g (Some t.range) ("Unexpected clash of variable names, please file a bug-report"); let d_non_info = let token = is_non_informative (push_binding g x ppname_default formal) (open_comp_with comp_typ (null_var x)) in match token with | None -> fail g (Some t.range) (Printf.sprintf "Unexpected non-informative result for %s" (P.comp_to_string comp_typ) ) | Some token -> RT.Non_informative_token _ _ (FStar.Squash.return_squash token) in let d:st_typing _ _ (open_comp_with comp_typ arg) = T_STGhostApp g head formal qual comp_typ arg x (lift_typing_to_ghost_typing dhead) (E d_non_info) (lift_typing_to_ghost_typing darg) in let d = canonicalize_st_typing d in let t = { term = Tm_STApp ({ head = head; arg_qual = qual; arg = arg }); range = range; effect_tag = as_effect_hint STT_Ghost } in let c = (canon_comp (open_comp_with comp_typ arg)) in (| t, c, d |) | _ -> fail g (Some t.range) "Expected an effectful application; got a pure term (could it be partially applied by mistake?)" in Prover.prove_post_hint (Prover.try_frame_pre_uvs ctxt_typing uvs (match_comp_res_with_post_hint d post_hint) res_ppname) post_hint t.range else fail g (Some t.range) (Printf.sprintf "Unexpected qualifier in head type %s of stateful application: head = %s, arg = %s" (P.term_to_string ty_head) (P.term_to_string head) (P.term_to_string arg)) | _ -> fail g (Some t.range) (Printf.sprintf "Unexpected head type in impure application: %s" (P.term_to_string ty_head))
{ "checked_file": "Pulse.Checker.STApp.fst.checked", "dependencies": [ "Pulse.Typing.FV.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Squash.fsti.checked", "FStar.Set.fsti.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.STApp.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.vprop", "Pulse.Typing.tot_typing", "Pulse.Syntax.Base.tm_vprop", "Pulse.Typing.post_hint_opt", "Pulse.Syntax.Base.ppname", "Pulse.Syntax.Base.st_term", "Prims.b2t", "Pulse.Syntax.Base.uu___is_Tm_STApp", "Pulse.Syntax.Base.__proj__Mkst_term__item__term", "Pulse.Typing.Env.extends_with", "Pulse.Syntax.Base.term", "FStar.Pervasives.Native.option", "Pulse.Syntax.Base.qualifier", "FStar.Stubs.TypeChecker.Core.tot_or_ghost", "Pulse.Typing.typing", "Pulse.Syntax.Pure.is_arrow", "Pulse.Syntax.Base.comp", "Prims.op_Equality", "Pulse.Syntax.Base.comp_st", "Pulse.Typing.st_typing", "Pulse.Checker.Prover.prove_post_hint", "Pulse.Syntax.Base.__proj__Mkst_term__item__range", "Pulse.Checker.Base.checker_result_t", "FStar.Pervasives.Native.None", "Pulse.Typing.post_hint_t", "Pulse.Checker.Prover.try_frame_pre_uvs", "FStar.Pervasives.dtuple3", "Pulse.Typing.Env.push_env", "Pulse.Checker.Base.match_comp_res_with_post_hint", "Pulse.Syntax.Base.st_comp", "FStar.Pervasives.Mkdtuple3", "Pulse.Checker.STApp.canon_comp", "Pulse.Syntax.Naming.open_comp_with", "Pulse.Syntax.Base.Mkst_term", "Pulse.Syntax.Base.Tm_STApp", "Pulse.Syntax.Base.Mkst_term'__Tm_STApp__payload", "Pulse.Syntax.Base.as_effect_hint", "Pulse.Syntax.Base.ctag_of_comp_st", "Pulse.Typing.wr", "Pulse.Checker.STApp.canonicalize_st_typing", "Pulse.Typing.T_STApp", "Pulse.Syntax.Base.STT_Ghost", "Pulse.Typing.T_STGhostApp", "Pulse.Typing.lift_typing_to_ghost_typing", "Pulse.Typing.E", "FStar.Reflection.Typing.non_informative", "Pulse.Typing.elab_env", "Pulse.Typing.Env.push_binding", "Pulse.Syntax.Base.ppname_default", "Pulse.Elaborate.Pure.elab_comp", "Pulse.Syntax.Pure.null_var", "Pulse.Typing.Env.fail", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.range", "Prims.string", "FStar.Printf.sprintf", "Pulse.Syntax.Printer.comp_to_string", "FStar.Tactics.Types.non_informative_token", "FStar.Reflection.Typing.Non_informative_token", "FStar.Squash.return_squash", "Pulse.Checker.Pure.is_non_informative", "Prims.unit", "FStar.Set.mem", "Pulse.Syntax.Base.var", "Pulse.Syntax.Naming.freevars_comp", "Prims.bool", "Prims.l_not", "Pulse.Typing.Env.dom", "Pulse.Typing.Env.fresh", "Prims.dtuple2", "Pulse.Checker.Pure.check_term_with_expected_type_and_effect", "FStar.Stubs.TypeChecker.Core.E_Ghost", "FStar.Stubs.TypeChecker.Core.E_Total", "Pulse.Syntax.Printer.term_to_string", "Prims.op_AmpAmp", "Prims.op_Negation", "Pulse.Syntax.Base.uu___is_C_STGhost", "Pulse.Checker.STApp.debug_log", "FStar.Tactics.V2.Builtins.print", "Pulse.Syntax.Pure.is_arrow_tm_arrow", "FStar.Pervasives.Native.tuple3", "Pulse.Syntax.Base.binder", "Pulse.Syntax.Printer.tot_or_ghost_to_string", "FStar.Pervasives.dtuple4", "Pulse.Checker.Pure.check_term", "Pulse.Syntax.Base.st_term'", "Prims._assert", "Pulse.Typing.Env.env_extends", "Pulse.Checker.STApp.instantiate_implicits", "Prims.eq2", "Pulse.Checker.Pure.push_context" ]
[]
module Pulse.Checker.STApp open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Pure open Pulse.Checker.Base module T = FStar.Tactics.V2 module RT = FStar.Reflection.Typing module FV = Pulse.Typing.FV module RU = Pulse.RuntimeUtils module P = Pulse.Syntax.Printer module Prover = Pulse.Checker.Prover let debug_log (g:env) (f:unit -> T.Tac unit) : T.Tac unit = if RU.debug_at_level (fstar_env g) "st_app" then f () else () let canon_comp (c:comp_st) : comp_st = match readback_comp (elab_comp c) with | None -> c | Some (C_Tot _) -> c //should be impossible | Some c' -> c' #push-options "--admit_smt_queries true" let canon_comp_eq_res (g:env) (c:comp_st) : RT.equiv (elab_env g) (elab_term (comp_res c)) (elab_term (comp_res (canon_comp c))) = RT.Rel_refl _ _ _ #pop-options let canonicalize_st_typing (#g:env) (#t:st_term) (#c:comp_st) (d:st_typing g t c) : st_typing g t (canon_comp c) = let c' = canon_comp c in let x = fresh g in assume ( ~(x `Set.mem` freevars (comp_post c)) /\ ~(x `Set.mem` freevars (comp_post c')) ); assume (st_equiv_pre c c'); let st_eq : st_equiv g c c' = ST_VPropEquiv g c c' x (magic ()) (magic()) (magic()) (canon_comp_eq_res g c) (magic()) (magic()) in T_Equiv _ _ _ _ d st_eq let coerce_eq (#a #b:Type) (x:a) (_:squash (a === b)) : y:b { y == x } = x let rec intro_uvars_for_logical_implicits (g:env) (uvs:env { disjoint uvs g }) (t:term) (ty:term) : T.Tac (uvs':env & g':env { extends_with g' g uvs' } & t':st_term { Tm_STApp? t'.term }) = let ropt = is_arrow ty in match ropt with | Some (b, Some Implicit, c_rest) -> let x = fresh (push_env g uvs) in let uvs' = push_binding uvs x ppname_default b.binder_ty in begin match c_rest with | C_ST _ | C_STAtomic _ _ | C_STGhost _ _ -> (| uvs', push_env g uvs', {term=Tm_STApp {head=t;arg_qual=Some Implicit;arg=null_var x}; range=t.range; effect_tag=as_effect_hint (ctag_of_comp_st c_rest) } |) | C_Tot ty -> intro_uvars_for_logical_implicits g uvs' (tm_pureapp t (Some Implicit) (null_var x)) ty end | _ -> fail g None (Printf.sprintf "check_stapp.intro_uvars_for_logical_implicits: expected an arrow type,\ with an implicit parameter, found: %s" (P.term_to_string ty)) let instantiate_implicits (g:env) (t:st_term { Tm_STApp? t.term }) : T.Tac (uvs : env & g' : env { extends_with g' g uvs } & t' : st_term { Tm_STApp? t'.term }) = let range = t.range in let Tm_STApp { head; arg_qual=qual; arg } = t.term in let pure_app = tm_pureapp head qual arg in let t, ty = instantiate_term_implicits g pure_app in match is_arrow ty with | Some (_, Some Implicit, _) -> //Some implicits to follow intro_uvars_for_logical_implicits g (mk_env (fstar_env g)) t ty | _ -> match is_pure_app t with | Some (head, q, arg) -> let uvs = mk_env (fstar_env g) in (| uvs, push_env g uvs, {term=Tm_STApp {head;arg_qual=q;arg}; range=t.range; effect_tag=default_effect_hint } |) | _ -> fail g (Some t.range) (Printf.sprintf "check_stapp.instantiate_implicits: expected an application term, found: %s" (P.term_to_string t)) #push-options "--z3rlimit_factor 4 --fuel 1 --ifuel 1" let check (g0:env) (ctxt:vprop) (ctxt_typing:tot_typing g0 ctxt tm_vprop) (post_hint:post_hint_opt g0) (res_ppname:ppname)
false
false
Pulse.Checker.STApp.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 1, "initial_ifuel": 1, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 4, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val check (g:env) (pre:term) (pre_typing:tot_typing g pre tm_vprop) (post_hint:post_hint_opt g) (res_ppname:ppname) (t:st_term{Tm_STApp? t.term}) : T.Tac (checker_result_t g pre post_hint)
[]
Pulse.Checker.STApp.check
{ "file_name": "lib/steel/pulse/Pulse.Checker.STApp.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
g: Pulse.Typing.Env.env -> pre: Pulse.Syntax.Base.term -> pre_typing: Pulse.Typing.tot_typing g pre Pulse.Syntax.Base.tm_vprop -> post_hint: Pulse.Typing.post_hint_opt g -> res_ppname: Pulse.Syntax.Base.ppname -> t: Pulse.Syntax.Base.st_term{Tm_STApp? (Mkst_term?.term t)} -> FStar.Tactics.Effect.Tac (Pulse.Checker.Base.checker_result_t g pre post_hint)
{ "end_col": 123, "end_line": 194, "start_col": 48, "start_line": 103 }
Prims.Tot
val va_quick_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ()))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_quick_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) = (va_QProc (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) (va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE) (va_wpProof_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE))
val va_quick_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) let va_quick_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) =
false
null
false
(va_QProc (va_code_Loop_rounds_0_15 ()) ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4 ]) (va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE) (va_wpProof_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.fsti.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.SHA.PPC64LE.Rounds.Core.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.SHA.PPC64LE.Rounds.fsti" }
[ "total" ]
[ "Vale.PPC64LE.Memory.buffer128", "Prims.nat", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.quad32", "Vale.PPC64LE.QuickCode.va_QProc", "Prims.unit", "Vale.SHA.PPC64LE.Rounds.va_code_Loop_rounds_0_15", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Vale.SHA.PPC64LE.Rounds.va_wp_Loop_rounds_0_15", "Vale.SHA.PPC64LE.Rounds.va_wpProof_Loop_rounds_0_15", "Vale.PPC64LE.QuickCode.va_quickCode" ]
[]
module Vale.SHA.PPC64LE.Rounds open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA.PPC64LE.Rounds.Core open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_0_15 val va_code_Loop_rounds_0_15 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_0_15 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_0_15 : va_b0:va_code -> va_s0:va_state -> in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_15 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_reg 4 va_sM (va_update_ok va_sM va_s0)))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4:nat64) (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 (va_upd_reg 4 va_x_r4 va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_15 : in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w)
false
false
Vale.SHA.PPC64LE.Rounds.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_quick_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ()))
[]
Vale.SHA.PPC64LE.Rounds.va_quick_Loop_rounds_0_15
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
in_b: Vale.PPC64LE.Memory.buffer128 -> offset: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> input_BE: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.SHA.PPC64LE.Rounds.va_code_Loop_rounds_0_15 ())
{ "end_col": 46, "end_line": 225, "start_col": 2, "start_line": 219 }
Prims.Tot
val va_quick_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_quick_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i)) = (va_QProc (va_code_Loop_rounds_16_47 i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) (va_wp_Loop_rounds_16_47 i k_b block hash_orig) (va_wpProof_Loop_rounds_16_47 i k_b block hash_orig))
val va_quick_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i)) let va_quick_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i)) =
false
null
false
(va_QProc (va_code_Loop_rounds_16_47 i) ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6 ]) (va_wp_Loop_rounds_16_47 i k_b block hash_orig) (va_wpProof_Loop_rounds_16_47 i k_b block hash_orig))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.fsti.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.SHA.PPC64LE.Rounds.Core.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.SHA.PPC64LE.Rounds.fsti" }
[ "total" ]
[ "Prims.nat", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCode.va_QProc", "Prims.unit", "Vale.SHA.PPC64LE.Rounds.va_code_Loop_rounds_16_47", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Vale.SHA.PPC64LE.Rounds.va_wp_Loop_rounds_16_47", "Vale.SHA.PPC64LE.Rounds.va_wpProof_Loop_rounds_16_47", "Vale.PPC64LE.QuickCode.va_quickCode" ]
[]
module Vale.SHA.PPC64LE.Rounds open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA.PPC64LE.Rounds.Core open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_0_15 val va_code_Loop_rounds_0_15 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_0_15 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_0_15 : va_b0:va_code -> va_s0:va_state -> in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_15 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_reg 4 va_sM (va_update_ok va_sM va_s0)))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4:nat64) (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 (va_upd_reg 4 va_x_r4 va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_15 : in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) = (va_QProc (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) (va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE) (va_wpProof_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE)) //-- //-- Loop_rounds_16_47 val va_code_Loop_rounds_16_47 : i:nat -> Tot va_code val va_codegen_success_Loop_rounds_16_47 : i:nat -> Tot va_pbool val va_lemma_Loop_rounds_16_47 : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_47 i) va_s0 /\ va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))) /\ (forall (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 va_s0))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_16_47 : i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_16_47 i k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_16_47 i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) :
false
false
Vale.SHA.PPC64LE.Rounds.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_quick_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i))
[]
Vale.SHA.PPC64LE.Rounds.va_quick_Loop_rounds_16_47
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
i: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.SHA.PPC64LE.Rounds.va_code_Loop_rounds_16_47 i)
{ "end_col": 15, "end_line": 372, "start_col": 2, "start_line": 366 }
Prims.Tot
val va_quick_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_48_63 ()))
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_quick_Loop_rounds_48_63 (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_48_63 ())) = (va_QProc (va_code_Loop_rounds_48_63 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) (va_wp_Loop_rounds_48_63 k_b block hash_orig) (va_wpProof_Loop_rounds_48_63 k_b block hash_orig))
val va_quick_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_48_63 ())) let va_quick_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_48_63 ())) =
false
null
false
(va_QProc (va_code_Loop_rounds_48_63 ()) ([ va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6 ]) (va_wp_Loop_rounds_48_63 k_b block hash_orig) (va_wpProof_Loop_rounds_48_63 k_b block hash_orig))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.fsti.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.SHA.PPC64LE.Rounds.Core.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.SHA.PPC64LE.Rounds.fsti" }
[ "total" ]
[ "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.QuickCode.va_QProc", "Prims.unit", "Vale.SHA.PPC64LE.Rounds.va_code_Loop_rounds_48_63", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Vale.SHA.PPC64LE.Rounds.va_wp_Loop_rounds_48_63", "Vale.SHA.PPC64LE.Rounds.va_wpProof_Loop_rounds_48_63", "Vale.PPC64LE.QuickCode.va_quickCode" ]
[]
module Vale.SHA.PPC64LE.Rounds open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA.PPC64LE.Rounds.Core open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_0_15 val va_code_Loop_rounds_0_15 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_0_15 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_0_15 : va_b0:va_code -> va_s0:va_state -> in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_15 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_reg 4 va_sM (va_update_ok va_sM va_s0)))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4:nat64) (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 (va_upd_reg 4 va_x_r4 va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_15 : in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) = (va_QProc (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) (va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE) (va_wpProof_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE)) //-- //-- Loop_rounds_16_47 val va_code_Loop_rounds_16_47 : i:nat -> Tot va_code val va_codegen_success_Loop_rounds_16_47 : i:nat -> Tot va_pbool val va_lemma_Loop_rounds_16_47 : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_47 i) va_s0 /\ va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))) /\ (forall (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 va_s0))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_16_47 : i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_16_47 i k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_16_47 i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i)) = (va_QProc (va_code_Loop_rounds_16_47 i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) (va_wp_Loop_rounds_16_47 i k_b block hash_orig) (va_wpProof_Loop_rounds_16_47 i k_b block hash_orig)) //-- //-- Loop_rounds_48_63 val va_code_Loop_rounds_48_63 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_48_63 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_48_63 : va_b0:va_code -> va_s0:va_state -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_48_63 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 13 3 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 6 va_s0 + 48 < pow2_64 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 48 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 48))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 48) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 33)) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 34)) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 35)) ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 36)) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 37)) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 38)) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 39)) ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 40)) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 41)) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 42)) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 43)) ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 44)) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 45)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 46)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 47) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 49) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 50)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 51))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 48 /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_48_63 (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 13 3 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 6 va_s0 + 48 < pow2_64 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 48 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 48))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 48) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 33)) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 34)) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 35)) ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 36)) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 37)) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 38)) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 39)) ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 40)) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 41)) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 42)) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 43)) ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 44)) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 45)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 46)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 47) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 49) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 50)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 51))) /\ (forall (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 va_s0))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 48 /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_48_63 : k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_48_63 k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_48_63 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_48_63 (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode
false
false
Vale.SHA.PPC64LE.Rounds.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_quick_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) : (va_quickCode unit (va_code_Loop_rounds_48_63 ()))
[]
Vale.SHA.PPC64LE.Rounds.va_quick_Loop_rounds_48_63
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.SHA.PPC64LE.Rounds.va_code_Loop_rounds_48_63 ())
{ "end_col": 15, "end_line": 522, "start_col": 2, "start_line": 516 }
Prims.Tot
val va_wp_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wp_Loop_rounds_48_63 (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 13 3 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 6 va_s0 + 48 < pow2_64 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 48 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 48))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 48) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 33)) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 34)) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 35)) ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 36)) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 37)) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 38)) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 39)) ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 40)) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 41)) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 42)) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 43)) ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 44)) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 45)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 46)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 47) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 49) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 50)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 51))) /\ (forall (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 va_s0))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 48 /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig) ==> va_k va_sM (())))
val va_wp_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 let va_wp_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 =
false
null
false
(va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 13 3 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 6 va_s0 + 48 < pow2_64 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 48 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 48))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 48) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 33)) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 34)) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 35)) ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 36)) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 37)) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 38)) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 39)) ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 40)) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 41)) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 42)) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 43)) ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 44)) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 45)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 46)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 47) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 49) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 50)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 51))) /\ (forall (va_x_r6: nat64) (va_x_v0: quad32) (va_x_v1: quad32) (va_x_v2: quad32) (va_x_v3: quad32) (va_x_v4: quad32) (va_x_v5: quad32) (va_x_v6: quad32) (va_x_v7: quad32) (va_x_v8: quad32) (va_x_v9: quad32) (va_x_v10: quad32) (va_x_v11: quad32) (va_x_v12: quad32) (va_x_v13: quad32) (va_x_v14: quad32) (va_x_v15: quad32) (va_x_v16: quad32) (va_x_v17: quad32) (va_x_v18: quad32) (va_x_v19: quad32) (va_x_v20: quad32) (va_x_v21: quad32) (va_x_v22: quad32) (va_x_v23: quad32) (va_x_v24: quad32) (va_x_v25: quad32) (va_x_v26: quad32). let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 ( va_upd_vec 2 va_x_v2 ( va_upd_vec 1 va_x_v1 ( va_upd_vec 0 va_x_v0 ( va_upd_reg 6 va_x_r6 va_s0 ) ) ) ) )) )))))))))) ))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 48 /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig) ==> va_k va_sM (())))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.fsti.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.SHA.PPC64LE.Rounds.Core.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.SHA.PPC64LE.Rounds.fsti" }
[ "total" ]
[ "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Prims.l_and", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.PPC64LE.Decls.validSrcAddrs128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.va_get_reg", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.Decls.validSrcAddrsOffset128", "Vale.SHA.PPC64LE.SHA_helpers.k_reqs", "Prims.op_LessThan", "Prims.op_Addition", "Vale.PPC64LE.Machine_s.pow2_64", "Prims.eq2", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Prims.l_Forall", "Vale.PPC64LE.Memory.nat64", "Vale.PPC64LE.Memory.quad32", "Prims.l_imp", "Prims.int", "Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.Decls.va_upd_vec", "Vale.PPC64LE.Decls.va_upd_reg" ]
[]
module Vale.SHA.PPC64LE.Rounds open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA.PPC64LE.Rounds.Core open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_0_15 val va_code_Loop_rounds_0_15 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_0_15 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_0_15 : va_b0:va_code -> va_s0:va_state -> in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_15 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_reg 4 va_sM (va_update_ok va_sM va_s0)))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4:nat64) (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 (va_upd_reg 4 va_x_r4 va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_15 : in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) = (va_QProc (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) (va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE) (va_wpProof_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE)) //-- //-- Loop_rounds_16_47 val va_code_Loop_rounds_16_47 : i:nat -> Tot va_code val va_codegen_success_Loop_rounds_16_47 : i:nat -> Tot va_pbool val va_lemma_Loop_rounds_16_47 : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_47 i) va_s0 /\ va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))) /\ (forall (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 va_s0))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_16_47 : i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_16_47 i k_b block hash_orig va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_16_47 i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) : (va_quickCode unit (va_code_Loop_rounds_16_47 i)) = (va_QProc (va_code_Loop_rounds_16_47 i) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6]) (va_wp_Loop_rounds_16_47 i k_b block hash_orig) (va_wpProof_Loop_rounds_16_47 i k_b block hash_orig)) //-- //-- Loop_rounds_48_63 val va_code_Loop_rounds_48_63 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_48_63 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_48_63 : va_b0:va_code -> va_s0:va_state -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_48_63 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 16 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 13 3 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 6 va_s0 + 48 < pow2_64 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 48 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 48))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 48) ((va_get_vec 1 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 33)) ((va_get_vec 2 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 34)) ((va_get_vec 3 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 35)) ((va_get_vec 4 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 36)) ((va_get_vec 5 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 37)) ((va_get_vec 6 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 38)) ((va_get_vec 7 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 39)) ((va_get_vec 8 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 40)) ((va_get_vec 9 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 41)) ((va_get_vec 10 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 42)) ((va_get_vec 11 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 43)) ((va_get_vec 12 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 44)) ((va_get_vec 13 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 45)) ((va_get_vec 14 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 46)) ((va_get_vec 15 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 47) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 49) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 50)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 51))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 48 /\ Vale.SHA.PPC64LE.SHA_helpers.make_seperated_hash_quad32 (va_get_vec 16 va_sM) (va_get_vec 17 va_sM) (va_get_vec 18 va_sM) (va_get_vec 19 va_sM) (va_get_vec 20 va_sM) (va_get_vec 21 va_sM) (va_get_vec 22 va_sM) (va_get_vec 23 va_sM) == Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale_64 block hash_orig) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_48_63 (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state)
false
true
Vale.SHA.PPC64LE.Rounds.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wp_Loop_rounds_48_63 (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[]
Vale.SHA.PPC64LE.Rounds.va_wp_Loop_rounds_48_63
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Type0
{ "end_col": 92, "end_line": 501, "start_col": 2, "start_line": 443 }
Prims.Tot
val va_wp_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4:nat64) (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 (va_upd_reg 4 va_x_r4 va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (())))
val va_wp_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 let va_wp_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 =
false
null
false
(va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4: nat64) (va_x_r6: nat64) (va_x_v0: quad32) (va_x_v1: quad32) (va_x_v2: quad32) (va_x_v3: quad32) (va_x_v4: quad32) (va_x_v5: quad32) (va_x_v6: quad32) (va_x_v7: quad32) (va_x_v8: quad32) (va_x_v9: quad32) (va_x_v10: quad32) (va_x_v11: quad32) (va_x_v12: quad32) (va_x_v13: quad32) (va_x_v14: quad32) (va_x_v15: quad32) (va_x_v16: quad32) (va_x_v17: quad32) (va_x_v18: quad32) (va_x_v19: quad32) (va_x_v20: quad32) (va_x_v21: quad32) (va_x_v22: quad32) (va_x_v23: quad32) (va_x_v24: quad32) (va_x_v25: quad32) (va_x_v26: quad32). let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 ( va_upd_vec 2 va_x_v2 ( va_upd_vec 1 va_x_v1 ( va_upd_vec 0 va_x_v0 ( va_upd_reg 6 va_x_r6 ( va_upd_reg 4 va_x_r4 va_s0 ) ) ) ) ) )) )))))))))) ))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ( l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5 )) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (())))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.fsti.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.SHA.PPC64LE.Rounds.Core.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.SHA.PPC64LE.Rounds.fsti" }
[ "total" ]
[ "Vale.PPC64LE.Memory.buffer128", "Prims.nat", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.quad32", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Prims.l_and", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.PPC64LE.Decls.validSrcAddrsOffset128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.va_get_reg", "Prims.op_Addition", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.SHA.PPC64LE.SHA_helpers.k_reqs", "Prims.op_LessThan", "Vale.PPC64LE.Machine_s.pow2_64", "Prims.eq2", "Vale.Arch.Types.reverse_bytes_quad32_seq", "FStar.Seq.Base.slice", "Vale.PPC64LE.Machine_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "FStar.Seq.Base.index", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "Prims.l_Forall", "Vale.PPC64LE.Memory.nat64", "Prims.l_imp", "Prims.int", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.Decls.va_upd_vec", "Vale.PPC64LE.Decls.va_upd_reg" ]
[]
module Vale.SHA.PPC64LE.Rounds open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA.PPC64LE.Rounds.Core open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_0_15 val va_code_Loop_rounds_0_15 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_0_15 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_0_15 : va_b0:va_code -> va_s0:va_state -> in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_15 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_reg 4 va_sM (va_update_ok va_sM va_s0)))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
false
true
Vale.SHA.PPC64LE.Rounds.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wp_Loop_rounds_0_15 (in_b: buffer128) (offset: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (input_BE: (seq quad32)) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[]
Vale.SHA.PPC64LE.Rounds.va_wp_Loop_rounds_0_15
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
in_b: Vale.PPC64LE.Memory.buffer128 -> offset: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> input_BE: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Type0
{ "end_col": 71, "end_line": 203, "start_col": 2, "start_line": 121 }
Prims.Tot
val va_wp_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[ { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA2.Wrapper", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.Rounds.Core", "short_module": null }, { "abbrev": false, "full_module": "Spec.Loops", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.Agile.Hash", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wp_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))) /\ (forall (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 va_s0))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) ==> va_k va_sM (())))
val va_wp_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 let va_wp_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 =
false
null
false
(va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))) /\ (forall (va_x_r6: nat64) (va_x_v0: quad32) (va_x_v1: quad32) (va_x_v2: quad32) (va_x_v3: quad32) (va_x_v4: quad32) (va_x_v5: quad32) (va_x_v6: quad32) (va_x_v7: quad32) (va_x_v8: quad32) (va_x_v9: quad32) (va_x_v10: quad32) (va_x_v11: quad32) (va_x_v12: quad32) (va_x_v13: quad32) (va_x_v14: quad32) (va_x_v15: quad32) (va_x_v16: quad32) (va_x_v17: quad32) (va_x_v18: quad32) (va_x_v19: quad32) (va_x_v20: quad32) (va_x_v21: quad32) (va_x_v22: quad32) (va_x_v23: quad32) (va_x_v24: quad32) (va_x_v25: quad32) (va_x_v26: quad32). let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 ( va_upd_vec 2 va_x_v2 ( va_upd_vec 1 va_x_v1 ( va_upd_vec 0 va_x_v0 ( va_upd_reg 6 va_x_r6 va_s0 ) ) ) ) )) )))))))))) ))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ( l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6) )) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) ==> va_k va_sM (())))
{ "checked_file": "Vale.SHA.PPC64LE.Rounds.fsti.checked", "dependencies": [ "Vale.SHA2.Wrapper.fsti.checked", "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.SHA.PPC64LE.Rounds.Core.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Stack_i.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsStack.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Loops.fst.checked", "Spec.Hash.Definitions.fst.checked", "Spec.Agile.Hash.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Vale.SHA.PPC64LE.Rounds.fsti" }
[ "total" ]
[ "Prims.nat", "Vale.PPC64LE.Memory.buffer128", "Vale.SHA.PPC64LE.SHA_helpers.block_w", "Vale.SHA.PPC64LE.SHA_helpers.hash256", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Prims.l_and", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.PPC64LE.Decls.validSrcAddrsOffset128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.va_get_reg", "Prims.op_Addition", "Prims.op_Division", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.SHA.PPC64LE.SHA_helpers.k_reqs", "Prims.op_LessThan", "Vale.PPC64LE.Machine_s.pow2_64", "Vale.Def.Words_s.nat32", "Vale.Def.Words_s.__proj__Mkfour__item__hi3", "Vale.Def.Types_s.nat32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32", "FStar.Seq.Base.index", "Vale.SHA.PPC64LE.SHA_helpers.word", "Vale.Arch.Types.add_wrap32", "Vale.SHA.PPC64LE.SHA_helpers.k_index", "Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale", "Vale.SHA.PPC64LE.SHA_helpers.ws_opaque", "Prims.op_Subtraction", "Vale.Def.Words_s.__proj__Mkfour__item__hi2", "Vale.Def.Words_s.__proj__Mkfour__item__lo1", "FStar.Seq.Base.seq", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.buffer128_as_seq", "Prims.l_Forall", "Vale.PPC64LE.Memory.nat64", "Vale.PPC64LE.Memory.quad32", "Prims.l_imp", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.Decls.va_upd_vec", "Vale.PPC64LE.Decls.va_upd_reg" ]
[]
module Vale.SHA.PPC64LE.Rounds open Vale.Def.Opaque_s open Vale.Def.Types_s open Vale.Def.Words_s open Vale.Def.Words.Seq_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.Stack_i open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsStack open Vale.PPC64LE.InsVector open Vale.SHA.PPC64LE.SHA_helpers open Spec.SHA2 open Spec.Agile.Hash open Spec.Hash.Definitions open Spec.Loops open Vale.SHA.PPC64LE.Rounds.Core open Vale.SHA2.Wrapper #reset-options "--z3rlimit 2000" //-- Loop_rounds_0_15 val va_code_Loop_rounds_0_15 : va_dummy:unit -> Tot va_code val va_codegen_success_Loop_rounds_0_15 : va_dummy:unit -> Tot va_pbool val va_lemma_Loop_rounds_0_15 : va_b0:va_code -> va_s0:va_state -> in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_0_15 ()) va_s0 /\ va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_reg 4 va_sM (va_update_ok va_sM va_s0)))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) in_b (offset + 1) 3 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b 1 4 (va_get_mem_layout va_s0) Secret /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in Vale.SHA.PPC64LE.SHA_helpers.k_reqs ks /\ va_get_reg 4 va_s0 + 48 < pow2_64 /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ input_BE == Vale.Arch.Types.reverse_bytes_quad32_seq (FStar.Seq.Base.slice #Vale.PPC64LE.Machine_s.quad32 (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) in_b) offset (offset + 4)) /\ block == Vale.SHA.PPC64LE.SHA_helpers.quads_to_block_be input_BE /\ va_get_vec 0 va_s0 == FStar.Seq.Base.index #quad32 input_BE 0 /\ (let hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 0 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 0)) ((va_get_vec 17 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 1))) ((va_get_vec 18 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 2))) ((va_get_vec 19 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 3))) ((va_get_vec 20 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 4))) ((va_get_vec 21 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 5))) ((va_get_vec 22 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 6))) ((va_get_vec 23 va_s0).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 0))) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 1) ((va_get_vec 24 va_s0).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 2)) ((va_get_vec 24 va_s0).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 3))) /\ (forall (va_x_r4:nat64) (va_x_r6:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) (va_x_v7:quad32) (va_x_v8:quad32) (va_x_v9:quad32) (va_x_v10:quad32) (va_x_v11:quad32) (va_x_v12:quad32) (va_x_v13:quad32) (va_x_v14:quad32) (va_x_v15:quad32) (va_x_v16:quad32) (va_x_v17:quad32) (va_x_v18:quad32) (va_x_v19:quad32) (va_x_v20:quad32) (va_x_v21:quad32) (va_x_v22:quad32) (va_x_v23:quad32) (va_x_v24:quad32) (va_x_v25:quad32) (va_x_v26:quad32) . let va_sM = va_upd_vec 26 va_x_v26 (va_upd_vec 25 va_x_v25 (va_upd_vec 24 va_x_v24 (va_upd_vec 23 va_x_v23 (va_upd_vec 22 va_x_v22 (va_upd_vec 21 va_x_v21 (va_upd_vec 20 va_x_v20 (va_upd_vec 19 va_x_v19 (va_upd_vec 18 va_x_v18 (va_upd_vec 17 va_x_v17 (va_upd_vec 16 va_x_v16 (va_upd_vec 15 va_x_v15 (va_upd_vec 14 va_x_v14 (va_upd_vec 13 va_x_v13 (va_upd_vec 12 va_x_v12 (va_upd_vec 11 va_x_v11 (va_upd_vec 10 va_x_v10 (va_upd_vec 9 va_x_v9 (va_upd_vec 8 va_x_v8 (va_upd_vec 7 va_x_v7 (va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 6 va_x_r6 (va_upd_reg 4 va_x_r4 va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ va_get_reg 4 va_sM == va_get_reg 4 va_s0 + 48 /\ (let ks = Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = Vale.SHA.PPC64LE.SHA_helpers.repeat_range_vale 16 block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 0)) ((va_get_vec 17 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 1))) ((va_get_vec 18 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 2))) ((va_get_vec 19 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 3))) ((va_get_vec 20 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 4))) ((va_get_vec 21 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 5))) ((va_get_vec 22 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 6))) ((va_get_vec 23 va_sM).hi3 == Vale.Arch.Types.add_wrap32 (Vale.SHA.PPC64LE.SHA_helpers.word_to_nat32 (FStar.Seq.Base.index #Vale.SHA.PPC64LE.SHA_helpers.word next_hash 7)) (Vale.SHA.PPC64LE.SHA_helpers.k_index ks 16))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 16) ((va_get_vec 1 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 1)) ((va_get_vec 2 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 2)) ((va_get_vec 3 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 3)) ((va_get_vec 4 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 4)) ((va_get_vec 5 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 5)) ((va_get_vec 6 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 6)) ((va_get_vec 7 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 7)) ((va_get_vec 8 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 8)) ((va_get_vec 9 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 9)) ((va_get_vec 10 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 10)) ((va_get_vec 11 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 11)) ((va_get_vec 12 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 12)) ((va_get_vec 13 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 13)) ((va_get_vec 14 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 14)) ((va_get_vec 15 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.ws_opaque block 15) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 17) ((va_get_vec 24 va_sM).hi2 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 18)) ((va_get_vec 24 va_sM).lo1 == Vale.SHA.PPC64LE.SHA_helpers.k_index ks 19))) ==> va_k va_sM (()))) val va_wpProof_Loop_rounds_0_15 : in_b:buffer128 -> offset:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> input_BE:(seq quad32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop_rounds_0_15 (in_b:buffer128) (offset:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256) (input_BE:(seq quad32)) : (va_quickCode unit (va_code_Loop_rounds_0_15 ())) = (va_QProc (va_code_Loop_rounds_0_15 ()) ([va_Mod_vec 26; va_Mod_vec 25; va_Mod_vec 24; va_Mod_vec 23; va_Mod_vec 22; va_Mod_vec 21; va_Mod_vec 20; va_Mod_vec 19; va_Mod_vec 18; va_Mod_vec 17; va_Mod_vec 16; va_Mod_vec 15; va_Mod_vec 14; va_Mod_vec 13; va_Mod_vec 12; va_Mod_vec 11; va_Mod_vec 10; va_Mod_vec 9; va_Mod_vec 8; va_Mod_vec 7; va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 6; va_Mod_reg 4]) (va_wp_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE) (va_wpProof_Loop_rounds_0_15 in_b offset k_b block hash_orig input_BE)) //-- //-- Loop_rounds_16_47 val va_code_Loop_rounds_16_47 : i:nat -> Tot va_code val va_codegen_success_Loop_rounds_16_47 : i:nat -> Tot va_pbool val va_lemma_Loop_rounds_16_47 : va_b0:va_code -> va_s0:va_state -> i:nat -> k_b:buffer128 -> block:block_w -> hash_orig:hash256 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop_rounds_16_47 i) va_s0 /\ va_get_ok va_s0 /\ (l_or (i == 16) (i == 32) /\ validSrcAddrsOffset128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 6 va_s0) k_b (i `op_Division` 4 + 1) 4 (va_get_mem_layout va_s0) Secret /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_s0) k_b in k_reqs ks /\ va_get_reg 6 va_s0 + 64 < pow2_64 /\ (let hash = repeat_range_vale i block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_s0).hi3 == word_to_nat32 (index hash 0)) ((va_get_vec 17 va_s0).hi3 == word_to_nat32 (index hash 1))) ((va_get_vec 18 va_s0).hi3 == word_to_nat32 (index hash 2))) ((va_get_vec 19 va_s0).hi3 == word_to_nat32 (index hash 3))) ((va_get_vec 20 va_s0).hi3 == word_to_nat32 (index hash 4))) ((va_get_vec 21 va_s0).hi3 == word_to_nat32 (index hash 5))) ((va_get_vec 22 va_s0).hi3 == word_to_nat32 (index hash 6))) ((va_get_vec 23 va_s0).hi3 == add_wrap32 (word_to_nat32 (index hash 7)) (k_index ks i))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_s0).hi3 == ws_opaque block i) ((va_get_vec 1 va_s0).hi3 == ws_opaque block (i - 15))) ((va_get_vec 2 va_s0).hi3 == ws_opaque block (i - 14))) ((va_get_vec 3 va_s0).hi3 == ws_opaque block (i - 13))) ((va_get_vec 4 va_s0).hi3 == ws_opaque block (i - 12))) ((va_get_vec 5 va_s0).hi3 == ws_opaque block (i - 11))) ((va_get_vec 6 va_s0).hi3 == ws_opaque block (i - 10))) ((va_get_vec 7 va_s0).hi3 == ws_opaque block (i - 9))) ((va_get_vec 8 va_s0).hi3 == ws_opaque block (i - 8))) ((va_get_vec 9 va_s0).hi3 == ws_opaque block (i - 7))) ((va_get_vec 10 va_s0).hi3 == ws_opaque block (i - 6))) ((va_get_vec 11 va_s0).hi3 == ws_opaque block (i - 5))) ((va_get_vec 12 va_s0).hi3 == ws_opaque block (i - 4))) ((va_get_vec 13 va_s0).hi3 == ws_opaque block (i - 3))) ((va_get_vec 14 va_s0).hi3 == ws_opaque block (i - 2))) ((va_get_vec 15 va_s0).hi3 == ws_opaque block (i - 1)) /\ l_and (l_and ((va_get_vec 24 va_s0).hi3 == k_index ks (i + 1)) ((va_get_vec 24 va_s0).hi2 == k_index ks (i + 2))) ((va_get_vec 24 va_s0).lo1 == k_index ks (i + 3)))))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg 6 va_sM == va_get_reg 6 va_s0 + 64 /\ (let ks = buffer128_as_seq (va_get_mem_heaplet 0 va_sM) k_b in (let next_hash = repeat_range_vale (i + 16) block hash_orig in l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 16 va_sM).hi3 == word_to_nat32 (index next_hash 0)) ((va_get_vec 17 va_sM).hi3 == word_to_nat32 (index next_hash 1))) ((va_get_vec 18 va_sM).hi3 == word_to_nat32 (index next_hash 2))) ((va_get_vec 19 va_sM).hi3 == word_to_nat32 (index next_hash 3))) ((va_get_vec 20 va_sM).hi3 == word_to_nat32 (index next_hash 4))) ((va_get_vec 21 va_sM).hi3 == word_to_nat32 (index next_hash 5))) ((va_get_vec 22 va_sM).hi3 == word_to_nat32 (index next_hash 6))) ((va_get_vec 23 va_sM).hi3 == add_wrap32 (word_to_nat32 (index next_hash 7)) (k_index ks (i + 16)))) /\ l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and (l_and ((va_get_vec 0 va_sM).hi3 == ws_opaque block (i + 16)) ((va_get_vec 1 va_sM).hi3 == ws_opaque block (i + 1))) ((va_get_vec 2 va_sM).hi3 == ws_opaque block (i + 2))) ((va_get_vec 3 va_sM).hi3 == ws_opaque block (i + 3))) ((va_get_vec 4 va_sM).hi3 == ws_opaque block (i + 4))) ((va_get_vec 5 va_sM).hi3 == ws_opaque block (i + 5))) ((va_get_vec 6 va_sM).hi3 == ws_opaque block (i + 6))) ((va_get_vec 7 va_sM).hi3 == ws_opaque block (i + 7))) ((va_get_vec 8 va_sM).hi3 == ws_opaque block (i + 8))) ((va_get_vec 9 va_sM).hi3 == ws_opaque block (i + 9))) ((va_get_vec 10 va_sM).hi3 == ws_opaque block (i + 10))) ((va_get_vec 11 va_sM).hi3 == ws_opaque block (i + 11))) ((va_get_vec 12 va_sM).hi3 == ws_opaque block (i + 12))) ((va_get_vec 13 va_sM).hi3 == ws_opaque block (i + 13))) ((va_get_vec 14 va_sM).hi3 == ws_opaque block (i + 14))) ((va_get_vec 15 va_sM).hi3 == ws_opaque block (i + 15)) /\ l_and (l_and ((va_get_vec 24 va_sM).hi3 == k_index ks (i + 17)) ((va_get_vec 24 va_sM).hi2 == k_index ks (i + 18))) ((va_get_vec 24 va_sM).lo1 == k_index ks (i + 19)))) /\ va_state_eq va_sM (va_update_vec 26 va_sM (va_update_vec 25 va_sM (va_update_vec 24 va_sM (va_update_vec 23 va_sM (va_update_vec 22 va_sM (va_update_vec 21 va_sM (va_update_vec 20 va_sM (va_update_vec 19 va_sM (va_update_vec 18 va_sM (va_update_vec 17 va_sM (va_update_vec 16 va_sM (va_update_vec 15 va_sM (va_update_vec 14 va_sM (va_update_vec 13 va_sM (va_update_vec 12 va_sM (va_update_vec 11 va_sM (va_update_vec 10 va_sM (va_update_vec 9 va_sM (va_update_vec 8 va_sM (va_update_vec 7 va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 6 va_sM (va_update_ok va_sM va_s0))))))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop_rounds_16_47 (i:nat) (k_b:buffer128) (block:block_w) (hash_orig:hash256)
false
true
Vale.SHA.PPC64LE.Rounds.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 2000, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wp_Loop_rounds_16_47 (i: nat) (k_b: buffer128) (block: block_w) (hash_orig: hash256) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
[]
Vale.SHA.PPC64LE.Rounds.va_wp_Loop_rounds_16_47
{ "file_name": "obj/Vale.SHA.PPC64LE.Rounds.fsti", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
i: Prims.nat -> k_b: Vale.PPC64LE.Memory.buffer128 -> block: Vale.SHA.PPC64LE.SHA_helpers.block_w -> hash_orig: Vale.SHA.PPC64LE.SHA_helpers.hash256 -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Type0
{ "end_col": 34, "end_line": 351, "start_col": 2, "start_line": 294 }
Prims.Tot
val bn_almost_mont_mul: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> lbignum t nLen
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Spec.AlmostMontgomery.Lemmas", "short_module": "AM" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let bn_almost_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_almost_mont_reduction n mu c
val bn_almost_mont_mul: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> lbignum t nLen let bn_almost_mont_mul #t #nLen n mu aM bM =
false
null
false
let c = BN.bn_mul aM bM in bn_almost_mont_reduction n mu c
{ "checked_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Montgomery.Lemmas.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst" }
[ "total" ]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_reduction", "Hacl.Spec.Bignum.bn_mul" ]
[]
module Hacl.Spec.Bignum.AlmostMontgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module M = Hacl.Spec.Montgomery.Lemmas module BN = Hacl.Spec.Bignum module BM = Hacl.Spec.Bignum.Montgomery friend Hacl.Spec.Bignum.Montgomery #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" /// Low-level specification of Almost Montgomery Multiplication let bn_almost_mont_reduction #t #nLen n mu c = let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res
false
false
Hacl.Spec.Bignum.AlmostMontgomery.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val bn_almost_mont_mul: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> lbignum t nLen
[]
Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_mul
{ "file_name": "code/bignum/Hacl.Spec.Bignum.AlmostMontgomery.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> bM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
{ "end_col": 33, "end_line": 29, "start_col": 44, "start_line": 27 }
Prims.Tot
val bn_almost_mont_sqr: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Spec.AlmostMontgomery.Lemmas", "short_module": "AM" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let bn_almost_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_almost_mont_reduction n mu c
val bn_almost_mont_sqr: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen let bn_almost_mont_sqr #t #nLen n mu aM =
false
null
false
let c = BN.bn_mul aM aM in bn_almost_mont_reduction n mu c
{ "checked_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Montgomery.Lemmas.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst" }
[ "total" ]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_reduction", "Hacl.Spec.Bignum.bn_mul" ]
[]
module Hacl.Spec.Bignum.AlmostMontgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module M = Hacl.Spec.Montgomery.Lemmas module BN = Hacl.Spec.Bignum module BM = Hacl.Spec.Bignum.Montgomery friend Hacl.Spec.Bignum.Montgomery #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" /// Low-level specification of Almost Montgomery Multiplication let bn_almost_mont_reduction #t #nLen n mu c = let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res let bn_almost_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_almost_mont_reduction n mu c // resM = c % n
false
false
Hacl.Spec.Bignum.AlmostMontgomery.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val bn_almost_mont_sqr: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen
[]
Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_sqr
{ "file_name": "code/bignum/Hacl.Spec.Bignum.AlmostMontgomery.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
{ "end_col": 33, "end_line": 33, "start_col": 41, "start_line": 31 }
Prims.Tot
val bn_almost_mont_reduction: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> lbignum t nLen
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Spec.AlmostMontgomery.Lemmas", "short_module": "AM" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let bn_almost_mont_reduction #t #nLen n mu c = let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res
val bn_almost_mont_reduction: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> lbignum t nLen let bn_almost_mont_reduction #t #nLen n mu c =
false
null
false
let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res
{ "checked_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Montgomery.Lemmas.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst" }
[ "total" ]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Base.carry", "Lib.Sequence.map2", "Hacl.Spec.Bignum.Base.mask_select", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.bn_sub", "Lib.IntTypes.int_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Subtraction_Dot", "Lib.IntTypes.uint", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r" ]
[]
module Hacl.Spec.Bignum.AlmostMontgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module M = Hacl.Spec.Montgomery.Lemmas module BN = Hacl.Spec.Bignum module BM = Hacl.Spec.Bignum.Montgomery friend Hacl.Spec.Bignum.Montgomery #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" /// Low-level specification of Almost Montgomery Multiplication
false
false
Hacl.Spec.Bignum.AlmostMontgomery.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val bn_almost_mont_reduction: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> lbignum t nLen
[]
Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_reduction
{ "file_name": "code/bignum/Hacl.Spec.Bignum.AlmostMontgomery.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> c: Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen) -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
{ "end_col": 33, "end_line": 25, "start_col": 46, "start_line": 21 }
FStar.Pervasives.Lemma
val bn_almost_mont_sqr_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_sqr n mu aM) == AM.almost_mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v aM))
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Spec.AlmostMontgomery.Lemmas", "short_module": "AM" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let bn_almost_mont_sqr_lemma #t #nLen n mu aM = bn_almost_mont_mul_lemma #t #nLen n mu aM aM
val bn_almost_mont_sqr_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_sqr n mu aM) == AM.almost_mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v aM)) let bn_almost_mont_sqr_lemma #t #nLen n mu aM =
false
null
true
bn_almost_mont_mul_lemma #t #nLen n mu aM aM
{ "checked_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Montgomery.Lemmas.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst" }
[ "lemma" ]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_mul_lemma", "Prims.unit" ]
[]
module Hacl.Spec.Bignum.AlmostMontgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module M = Hacl.Spec.Montgomery.Lemmas module BN = Hacl.Spec.Bignum module BM = Hacl.Spec.Bignum.Montgomery friend Hacl.Spec.Bignum.Montgomery #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" /// Low-level specification of Almost Montgomery Multiplication let bn_almost_mont_reduction #t #nLen n mu c = let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res let bn_almost_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_almost_mont_reduction n mu c // resM = c % n let bn_almost_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_almost_mont_reduction n mu c // resM = c % n let bn_almost_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let r2 = pow2 (pbits * (nLen + nLen)) in Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen); assert (r2 == r * r); let c0, res1 = BM.bn_mont_reduction_loop_div_r #t #nLen n mu res0 in let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in BM.bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; assert (v c0 * r + bn_v res1 == resM1); let resM = if resM1 < r then resM1 else resM1 - bn_v n in //assert (resM == AM.almost_mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0)); let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res1 n in BN.bn_sub_lemma res1 n; assert (bn_v tmp - v c1 * r == bn_v res1 - bn_v n); let res = map2 (mask_select mask) tmp res1 in lseq_mask_select_lemma tmp res1 mask; assert (res == (if v mask = 0 then res1 else tmp)); bn_eval_bound res1 nLen; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); bn_eval_bound res0 (nLen + nLen); AM.lemma_fits_c_lt_rr (bn_v res0) r (bn_v n); assert (resM1 < r + bn_v n) let bn_almost_mont_mul_lemma #t #nLen n mu aM bM = let r = pow2 (bits t * nLen) in let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); bn_almost_mont_reduction_lemma n mu c
false
false
Hacl.Spec.Bignum.AlmostMontgomery.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val bn_almost_mont_sqr_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_sqr n mu aM) == AM.almost_mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v aM))
[]
Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_sqr_lemma
{ "file_name": "code/bignum/Hacl.Spec.Bignum.AlmostMontgomery.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu) (ensures Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_sqr n mu aM) == Hacl.Spec.AlmostMontgomery.Lemmas.almost_mont_mul (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v aM) (Hacl.Spec.Bignum.Definitions.bn_v aM))
{ "end_col": 46, "end_line": 77, "start_col": 2, "start_line": 77 }
FStar.Pervasives.Lemma
val bn_almost_mont_mul_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_mul n mu aM bM) == AM.almost_mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v bM))
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Spec.AlmostMontgomery.Lemmas", "short_module": "AM" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let bn_almost_mont_mul_lemma #t #nLen n mu aM bM = let r = pow2 (bits t * nLen) in let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); bn_almost_mont_reduction_lemma n mu c
val bn_almost_mont_mul_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_mul n mu aM bM) == AM.almost_mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v bM)) let bn_almost_mont_mul_lemma #t #nLen n mu aM bM =
false
null
true
let r = pow2 (bits t * nLen) in let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); bn_almost_mont_reduction_lemma n mu c
{ "checked_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Montgomery.Lemmas.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst" }
[ "lemma" ]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_reduction_lemma", "Prims.unit", "Prims._assert", "Prims.eq2", "Prims.int", "Hacl.Spec.Bignum.Definitions.bn_v", "FStar.Mul.op_Star", "Hacl.Spec.Bignum.bn_mul_lemma", "Hacl.Spec.Bignum.bn_mul", "Prims.pos", "Prims.pow2", "Lib.IntTypes.bits" ]
[]
module Hacl.Spec.Bignum.AlmostMontgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module M = Hacl.Spec.Montgomery.Lemmas module BN = Hacl.Spec.Bignum module BM = Hacl.Spec.Bignum.Montgomery friend Hacl.Spec.Bignum.Montgomery #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" /// Low-level specification of Almost Montgomery Multiplication let bn_almost_mont_reduction #t #nLen n mu c = let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res let bn_almost_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_almost_mont_reduction n mu c // resM = c % n let bn_almost_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_almost_mont_reduction n mu c // resM = c % n let bn_almost_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let r2 = pow2 (pbits * (nLen + nLen)) in Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen); assert (r2 == r * r); let c0, res1 = BM.bn_mont_reduction_loop_div_r #t #nLen n mu res0 in let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in BM.bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; assert (v c0 * r + bn_v res1 == resM1); let resM = if resM1 < r then resM1 else resM1 - bn_v n in //assert (resM == AM.almost_mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0)); let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res1 n in BN.bn_sub_lemma res1 n; assert (bn_v tmp - v c1 * r == bn_v res1 - bn_v n); let res = map2 (mask_select mask) tmp res1 in lseq_mask_select_lemma tmp res1 mask; assert (res == (if v mask = 0 then res1 else tmp)); bn_eval_bound res1 nLen; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); bn_eval_bound res0 (nLen + nLen); AM.lemma_fits_c_lt_rr (bn_v res0) r (bn_v n); assert (resM1 < r + bn_v n)
false
false
Hacl.Spec.Bignum.AlmostMontgomery.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val bn_almost_mont_mul_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_mul n mu aM bM) == AM.almost_mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v bM))
[]
Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_mul_lemma
{ "file_name": "code/bignum/Hacl.Spec.Bignum.AlmostMontgomery.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> bM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu) (ensures Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_mul n mu aM bM) == Hacl.Spec.AlmostMontgomery.Lemmas.almost_mont_mul (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v aM) (Hacl.Spec.Bignum.Definitions.bn_v bM))
{ "end_col": 39, "end_line": 73, "start_col": 50, "start_line": 68 }
FStar.Pervasives.Lemma
val bn_almost_mont_reduction_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_reduction n mu c) == AM.almost_mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c))
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Spec.AlmostMontgomery.Lemmas", "short_module": "AM" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let bn_almost_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let r2 = pow2 (pbits * (nLen + nLen)) in Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen); assert (r2 == r * r); let c0, res1 = BM.bn_mont_reduction_loop_div_r #t #nLen n mu res0 in let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in BM.bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; assert (v c0 * r + bn_v res1 == resM1); let resM = if resM1 < r then resM1 else resM1 - bn_v n in //assert (resM == AM.almost_mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0)); let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res1 n in BN.bn_sub_lemma res1 n; assert (bn_v tmp - v c1 * r == bn_v res1 - bn_v n); let res = map2 (mask_select mask) tmp res1 in lseq_mask_select_lemma tmp res1 mask; assert (res == (if v mask = 0 then res1 else tmp)); bn_eval_bound res1 nLen; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); bn_eval_bound res0 (nLen + nLen); AM.lemma_fits_c_lt_rr (bn_v res0) r (bn_v n); assert (resM1 < r + bn_v n)
val bn_almost_mont_reduction_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_reduction n mu c) == AM.almost_mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c)) let bn_almost_mont_reduction_lemma #t #nLen n mu res0 =
false
null
true
let pbits = bits t in let r = pow2 (pbits * nLen) in let r2 = pow2 (pbits * (nLen + nLen)) in Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen); assert (r2 == r * r); let c0, res1 = BM.bn_mont_reduction_loop_div_r #t #nLen n mu res0 in let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in BM.bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; assert (v c0 * r + bn_v res1 == resM1); let resM = if resM1 < r then resM1 else resM1 - bn_v n in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res1 n in BN.bn_sub_lemma res1 n; assert (bn_v tmp - v c1 * r == bn_v res1 - bn_v n); let res = map2 (mask_select mask) tmp res1 in lseq_mask_select_lemma tmp res1 mask; assert (res == (if v mask = 0 then res1 else tmp)); bn_eval_bound res1 nLen; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); bn_eval_bound res0 (nLen + nLen); AM.lemma_fits_c_lt_rr (bn_v res0) r (bn_v n); assert (resM1 < r + bn_v n)
{ "checked_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Montgomery.Lemmas.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Montgomery.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.AlmostMontgomery.fst" }
[ "lemma" ]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Base.carry", "Prims._assert", "Prims.op_LessThan", "Hacl.Spec.Bignum.Definitions.bn_v", "Prims.unit", "Hacl.Spec.AlmostMontgomery.Lemmas.lemma_fits_c_lt_rr", "Hacl.Spec.Bignum.Definitions.bn_eval_bound", "FStar.Mul.op_Star", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Prims.op_Division", "Prims.op_Subtraction", "Hacl.Spec.Montgomery.Lemmas.mont_reduction_loop_div_r_fits_lemma", "Lib.IntTypes.bits", "Prims.eq2", "Lib.Sequence.lseq", "Prims.op_Equality", "Prims.int", "Prims.bool", "Hacl.Spec.Bignum.Base.lseq_mask_select_lemma", "Prims.l_Forall", "Prims.nat", "Prims.l_imp", "Lib.Sequence.index", "Hacl.Spec.Bignum.Base.mask_select", "Lib.Sequence.map2", "Hacl.Spec.Bignum.bn_sub_lemma", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.bn_sub", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Subtraction_Dot", "Lib.IntTypes.uint", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r_lemma", "Hacl.Spec.Montgomery.Lemmas.mont_reduction_loop_div_r", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r", "FStar.Math.Lemmas.pow2_plus", "Prims.pos", "Prims.pow2" ]
[]
module Hacl.Spec.Bignum.AlmostMontgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module M = Hacl.Spec.Montgomery.Lemmas module BN = Hacl.Spec.Bignum module BM = Hacl.Spec.Bignum.Montgomery friend Hacl.Spec.Bignum.Montgomery #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" /// Low-level specification of Almost Montgomery Multiplication let bn_almost_mont_reduction #t #nLen n mu c = let c0, res = BM.bn_mont_reduction_loop_div_r #t #nLen n mu c in let mask = uint #t 0 -. c0 in let c1, tmp = BN.bn_sub res n in map2 (mask_select mask) tmp res let bn_almost_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_almost_mont_reduction n mu c // resM = c % n let bn_almost_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_almost_mont_reduction n mu c // resM = c % n
false
false
Hacl.Spec.Bignum.AlmostMontgomery.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val bn_almost_mont_reduction_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (requires BM.bn_mont_pre n mu) (ensures bn_v (bn_almost_mont_reduction n mu c) == AM.almost_mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c))
[]
Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_reduction_lemma
{ "file_name": "code/bignum/Hacl.Spec.Bignum.AlmostMontgomery.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> c: Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen) -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu) (ensures Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.AlmostMontgomery.bn_almost_mont_reduction n mu c) == Hacl.Spec.AlmostMontgomery.Lemmas.almost_mont_reduction (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v c))
{ "end_col": 29, "end_line": 65, "start_col": 55, "start_line": 36 }
FStar.Pervasives.Lemma
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_repeat = repeat_induction
let lemma_repeat =
false
null
true
repeat_induction
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "lemma" ]
[ "Spec.Loops.repeat_induction", "Prims.nat", "Prims.b2t", "Prims.op_GreaterThan", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.eq2", "Spec.Loops.repeat", "Prims.op_Subtraction", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min) #reset-options "--max_fuel 0" [@(deprecated "Spec.Loops.repeat")] unfold let repeat_spec = repeat [@(deprecated "Spec.Loops.repeat_base")] unfold let lemma_repeat_0 = repeat_base [@(deprecated "Spec.Loops.repeat_induction")]
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_repeat : n: Prims.nat{n > 0} -> f: (_: _ -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat n f x == f (Spec.Loops.repeat (n - 1) f x))
[]
Spec.Loops.lemma_repeat
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
n: Prims.nat{n > 0} -> f: (_: _ -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat n f x == f (Spec.Loops.repeat (n - 1) f x))
{ "end_col": 35, "end_line": 84, "start_col": 19, "start_line": 84 }
FStar.Pervasives.Lemma
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_repeat_range_spec = repeat_range_induction
let lemma_repeat_range_spec =
false
null
true
repeat_range_induction
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "lemma", "" ]
[ "Spec.Loops.repeat_range_induction", "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.unit", "Prims.op_Subtraction", "Prims.l_True", "Prims.squash", "Prims.eq2", "Spec.Loops.repeat_range", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min) #reset-options "--max_fuel 0" [@(deprecated "Spec.Loops.repeat")] unfold let repeat_spec = repeat [@(deprecated "Spec.Loops.repeat_base")] unfold let lemma_repeat_0 = repeat_base [@(deprecated "Spec.Loops.repeat_induction")] unfold let lemma_repeat = repeat_induction [@(deprecated "Spec.Loops.repeat_range")] unfold let repeat_range_spec = repeat_range [@(deprecated "Spec.Loops.repeat_range_base")] unfold let lemma_repeat_range_0 = repeat_range_base [@(deprecated "Spec.Loops.repeat_range_induction")]
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_repeat_range_spec : min: Prims.nat -> max: Prims.nat{min < max} -> f: (_: _ -> i: Prims.nat{i < max} -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures f (Spec.Loops.repeat_range min (max - 1) f x) (max - 1) == Spec.Loops.repeat_range min max f x) (decreases max - min)
[]
Spec.Loops.lemma_repeat_range_spec
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
min: Prims.nat -> max: Prims.nat{min < max} -> f: (_: _ -> i: Prims.nat{i < max} -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures f (Spec.Loops.repeat_range min (max - 1) f x) (max - 1) == Spec.Loops.repeat_range min max f x) (decreases max - min)
{ "end_col": 52, "end_line": 94, "start_col": 30, "start_line": 94 }
Prims.Tot
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let repeat_range_spec = repeat_range
let repeat_range_spec =
false
null
false
repeat_range
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "total", "" ]
[ "Spec.Loops.repeat_range", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_LessThan", "Prims.op_Subtraction" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min) #reset-options "--max_fuel 0" [@(deprecated "Spec.Loops.repeat")] unfold let repeat_spec = repeat [@(deprecated "Spec.Loops.repeat_base")] unfold let lemma_repeat_0 = repeat_base [@(deprecated "Spec.Loops.repeat_induction")] unfold let lemma_repeat = repeat_induction [@(deprecated "Spec.Loops.repeat_range")]
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val repeat_range_spec : min: Prims.nat -> max: Prims.nat{min <= max} -> f: (_: _ -> i: Prims.nat{i < max} -> _) -> x: _ -> Prims.Tot _
[]
Spec.Loops.repeat_range_spec
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
min: Prims.nat -> max: Prims.nat{min <= max} -> f: (_: _ -> i: Prims.nat{i < max} -> _) -> x: _ -> Prims.Tot _
{ "end_col": 36, "end_line": 88, "start_col": 24, "start_line": 88 }
Prims.Tot
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let repeat_spec = repeat
let repeat_spec =
false
null
false
repeat
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "total", "" ]
[ "Spec.Loops.repeat", "Prims.nat" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min) #reset-options "--max_fuel 0" [@(deprecated "Spec.Loops.repeat")]
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val repeat_spec : n: Prims.nat -> f: (f: _ -> _) -> x: _ -> Prims.Tot _
[]
Spec.Loops.repeat_spec
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
n: Prims.nat -> f: (f: _ -> _) -> x: _ -> Prims.Tot _
{ "end_col": 24, "end_line": 78, "start_col": 18, "start_line": 78 }
FStar.Pervasives.Lemma
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_repeat_0 = repeat_base
let lemma_repeat_0 =
false
null
true
repeat_base
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "lemma" ]
[ "Spec.Loops.repeat_base", "Prims.nat", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.eq2", "Spec.Loops.repeat", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min) #reset-options "--max_fuel 0" [@(deprecated "Spec.Loops.repeat")] unfold let repeat_spec = repeat [@(deprecated "Spec.Loops.repeat_base")]
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_repeat_0 : n: Prims.nat{n = 0} -> f: (_: _ -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat n f x == x)
[]
Spec.Loops.lemma_repeat_0
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
n: Prims.nat{n = 0} -> f: (_: _ -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat n f x == x)
{ "end_col": 32, "end_line": 81, "start_col": 21, "start_line": 81 }
FStar.Pervasives.Lemma
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_repeat_range_0 = repeat_range_base
let lemma_repeat_range_0 =
false
null
true
repeat_range_base
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "lemma" ]
[ "Spec.Loops.repeat_range_base", "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.eq2", "Spec.Loops.repeat_range", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min) #reset-options "--max_fuel 0" [@(deprecated "Spec.Loops.repeat")] unfold let repeat_spec = repeat [@(deprecated "Spec.Loops.repeat_base")] unfold let lemma_repeat_0 = repeat_base [@(deprecated "Spec.Loops.repeat_induction")] unfold let lemma_repeat = repeat_induction [@(deprecated "Spec.Loops.repeat_range")] unfold let repeat_range_spec = repeat_range [@(deprecated "Spec.Loops.repeat_range_base")]
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_repeat_range_0 : min: Prims.nat -> f: (_: _ -> i: Prims.nat{i < min} -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat_range min min f x == x)
[]
Spec.Loops.lemma_repeat_range_0
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
min: Prims.nat -> f: (_: _ -> i: Prims.nat{i < min} -> _) -> x: _ -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat_range min min f x == x)
{ "end_col": 44, "end_line": 91, "start_col": 27, "start_line": 91 }
Prims.Tot
val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n)
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x)
val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x =
false
null
false
if n = 0 then x else repeat (n - 1) f (f x)
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "total", "" ]
[ "Prims.nat", "Prims.op_Equality", "Prims.int", "Prims.bool", "Spec.Loops.repeat", "Prims.op_Subtraction" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n)
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n)
[ "recursion" ]
Spec.Loops.repeat
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
n: Prims.nat -> f: (f: a -> a) -> x: a -> Prims.Tot a
{ "end_col": 43, "end_line": 35, "start_col": 2, "start_line": 35 }
Prims.Tot
val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min))
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min)
val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x =
false
null
false
if min = max then x else repeat_range (min + 1) max f (f x min)
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "total", "" ]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_LessThan", "Prims.op_Equality", "Prims.bool", "Spec.Loops.repeat_range", "Prims.op_Addition" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min))
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min))
[ "recursion" ]
Spec.Loops.repeat_range
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
min: Prims.nat -> max: Prims.nat{min <= max} -> f: (_: a -> i: Prims.nat{i < max} -> a) -> x: a -> Prims.Tot a
{ "end_col": 43, "end_line": 55, "start_col": 2, "start_line": 54 }
FStar.Pervasives.Lemma
val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x))
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x)
val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x =
false
null
true
if n = 1 then () else repeat_induction (n - 1) f (f x)
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "lemma" ]
[ "Prims.nat", "Prims.b2t", "Prims.op_GreaterThan", "Prims.op_Equality", "Prims.int", "Prims.bool", "Spec.Loops.repeat_induction", "Prims.op_Subtraction", "Prims.unit" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x))
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x))
[ "recursion" ]
Spec.Loops.repeat_induction
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
n: Prims.nat{n > 0} -> f: (_: a -> a) -> x: a -> FStar.Pervasives.Lemma (ensures Spec.Loops.repeat n f x == f (Spec.Loops.repeat (n - 1) f x))
{ "end_col": 37, "end_line": 43, "start_col": 2, "start_line": 42 }
Prims.Tot
val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s))
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s'
val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s =
false
null
false
if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s'
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "total", "" ]
[ "FStar.Seq.Base.seq", "Prims.op_Equality", "Prims.int", "FStar.Seq.Base.length", "FStar.Seq.Base.empty", "Prims.bool", "FStar.Seq.Properties.cons", "FStar.Seq.Properties.head", "Spec.Loops.seq_map", "FStar.Seq.Properties.tail", "Prims.l_and", "Prims.b2t", "Prims.nat", "Prims.l_Forall", "Prims.l_imp", "Prims.op_LessThan", "Prims.eq2", "FStar.Seq.Base.index" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s))
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s))
[ "recursion" ]
Spec.Loops.seq_map
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
f: (_: a -> b) -> s: FStar.Seq.Base.seq a -> Prims.Tot (s': FStar.Seq.Base.seq b { FStar.Seq.Base.length s = FStar.Seq.Base.length s' /\ (forall (i: Prims.nat). {:pattern FStar.Seq.Base.index s' i} i < FStar.Seq.Base.length s' ==> FStar.Seq.Base.index s' i == f (FStar.Seq.Base.index s i)) })
{ "end_col": 6, "end_line": 17, "start_col": 2, "start_line": 13 }
FStar.Pervasives.Lemma
val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min))
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec repeat_range_induction #a min max f x = if min = max - 1 then () else repeat_range_induction (min+1) max f (f x min)
val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min)) let rec repeat_range_induction #a min max f x =
false
null
true
if min = max - 1 then () else repeat_range_induction (min + 1) max f (f x min)
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "lemma", "" ]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Equality", "Prims.int", "Prims.op_Subtraction", "Prims.bool", "Spec.Loops.repeat_range_induction", "Prims.op_Addition", "Prims.unit" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s'' val repeat: #a:Type -> n:nat -> (f: a -> Tot a) -> a -> Tot a (decreases n) let rec repeat #a n f x = if n = 0 then x else repeat (n-1) f (f x) #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_induction: #a:Type -> n:nat{n > 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == f (repeat (n-1) f x)) let rec repeat_induction #a n f x = if n = 1 then () else repeat_induction (n-1) f (f x) val repeat_base: #a:Type -> n:nat{n = 0} -> f:( a -> Tot a) -> x:a -> Lemma (repeat n f x == x) let rec repeat_base #a n f x = () #reset-options "--max_fuel 0" val repeat_range: #a:Type -> min:nat -> max:nat{min <= max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Tot a (decreases (max - min)) let rec repeat_range #a min max f x = if min = max then x else repeat_range (min+1) max f (f x min) #reset-options "--initial_fuel 1 --max_fuel 1" val repeat_range_base: #a:Type -> min:nat -> f:(a -> i:nat{i < min} -> Tot a) -> x:a -> Lemma (ensures (repeat_range min min f x == x)) let repeat_range_base #a min f x = () #reset-options "--initial_fuel 2 --max_fuel 2" val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min))
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val repeat_range_induction: #a:Type -> min:nat -> max:nat{min < max} -> f:(a -> i:nat{i < max} -> Tot a) -> x:a -> Lemma (requires (True)) (ensures f (repeat_range min (max-1) f x) (max-1) == repeat_range min max f x) (decreases (max - min))
[ "recursion" ]
Spec.Loops.repeat_range_induction
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
min: Prims.nat -> max: Prims.nat{min < max} -> f: (_: a -> i: Prims.nat{i < max} -> a) -> x: a -> FStar.Pervasives.Lemma (ensures f (Spec.Loops.repeat_range min (max - 1) f x) (max - 1) == Spec.Loops.repeat_range min max f x) (decreases max - min)
{ "end_col": 53, "end_line": 72, "start_col": 2, "start_line": 71 }
Prims.Tot
val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s))
[ { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec seq_map2 #a #b #c f s s' = if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s''
val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s)) let rec seq_map2 #a #b #c f s s' =
false
null
false
if Seq.length s = 0 then Seq.empty else let s'' = Seq.cons (f (Seq.head s) (Seq.head s')) (seq_map2 f (Seq.tail s) (Seq.tail s')) in s''
{ "checked_file": "Spec.Loops.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Spec.Loops.fst" }
[ "total", "" ]
[ "FStar.Seq.Base.seq", "Prims.b2t", "Prims.op_Equality", "Prims.nat", "FStar.Seq.Base.length", "Prims.int", "FStar.Seq.Base.empty", "Prims.bool", "FStar.Seq.Properties.cons", "FStar.Seq.Properties.head", "Spec.Loops.seq_map2", "FStar.Seq.Properties.tail", "Prims.l_and", "Prims.l_Forall", "Prims.l_imp", "Prims.op_LessThan", "Prims.eq2", "FStar.Seq.Base.index" ]
[]
module Spec.Loops #reset-options "--max_fuel 0" val seq_map: #a:Type -> #b:Type -> f:(a -> Tot b) -> s:Seq.seq a -> Tot (s':Seq.seq b{Seq.length s = Seq.length s' /\ (forall (i:nat). {:pattern (Seq.index s' i)} i < Seq.length s' ==> Seq.index s' i == f (Seq.index s i))}) (decreases (Seq.length s)) let rec seq_map #a #b f s = if Seq.length s = 0 then Seq.empty else let s' = Seq.cons (f (Seq.head s)) (seq_map f (Seq.tail s)) in s' val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s))
false
false
Spec.Loops.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val seq_map2: #a:Type -> #b:Type -> #c:Type -> f:(a -> b -> Tot c) -> s:Seq.seq a -> s':Seq.seq b{Seq.length s = Seq.length s'} -> Tot (s'':Seq.seq c{Seq.length s = Seq.length s'' /\ (forall (i:nat). {:pattern (Seq.index s'' i)} i < Seq.length s'' ==> Seq.index s'' i == f (Seq.index s i) (Seq.index s' i))}) (decreases (Seq.length s))
[ "recursion" ]
Spec.Loops.seq_map2
{ "file_name": "krmllib/Spec.Loops.fst", "git_rev": "a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd", "git_url": "https://github.com/FStarLang/karamel.git", "project_name": "karamel" }
f: (_: a -> _: b -> c) -> s: FStar.Seq.Base.seq a -> s': FStar.Seq.Base.seq b {FStar.Seq.Base.length s = FStar.Seq.Base.length s'} -> Prims.Tot (s'': FStar.Seq.Base.seq c { FStar.Seq.Base.length s = FStar.Seq.Base.length s'' /\ (forall (i: Prims.nat). {:pattern FStar.Seq.Base.index s'' i} i < FStar.Seq.Base.length s'' ==> FStar.Seq.Base.index s'' i == f (FStar.Seq.Base.index s i) (FStar.Seq.Base.index s' i) ) })
{ "end_col": 7, "end_line": 31, "start_col": 2, "start_line": 28 }
FStar.Pervasives.Lemma
val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12
val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f =
false
null
true
lemma_as_nat_bound_f4_lt_powa f 12
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.felem5", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_bound_f4_lt_powa", "Prims.unit" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_bound_f4_lt_pow12
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
f: Hacl.Spec.K256.Field52.Definitions.felem5 -> FStar.Pervasives.Lemma (requires (let _ = f in (let FStar.Pervasives.Native.Mktuple5 #_ #_ #_ #_ #_ _ _ _ _ f4 = _ in Hacl.Spec.K256.Field52.Definitions.felem_fits5 f (1, 1, 1, 1, 1) /\ Lib.IntTypes.v f4 < Prims.pow2 12) <: Type0)) (ensures Hacl.Spec.K256.Field52.Definitions.as_nat5 f <= Prims.pow2 220 - 1)
{ "end_col": 36, "end_line": 140, "start_col": 2, "start_line": 140 }
FStar.Pervasives.Lemma
val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48
val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f =
false
null
true
lemma_as_nat_bound_f4_lt_powa f 48
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.felem5", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_bound_f4_lt_powa", "Prims.unit" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_bound
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
f: Hacl.Spec.K256.Field52.Definitions.felem5 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits5 f (1, 1, 1, 1, 1)) (ensures Hacl.Spec.K256.Field52.Definitions.as_nat5 f < Prims.pow2 256)
{ "end_col": 36, "end_line": 131, "start_col": 2, "start_line": 131 }
FStar.Pervasives.Lemma
val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2)
val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x =
false
null
true
let x0, x1, x2, x3, x4 = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2)
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.felem5", "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Hacl.Spec.K256.Field52.Definitions.as_nat5", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.unit", "Hacl.Spec.K256.MathLemmas.lemma_a_plus_b_pow2_mod2", "Prims.op_Addition", "FStar.Mul.op_Star", "Hacl.Spec.K256.Field52.Definitions.pow52", "Hacl.Spec.K256.Field52.Definitions.pow104", "Hacl.Spec.K256.Field52.Definitions.pow156", "Hacl.Spec.K256.Field52.Definitions.pow208" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 ->
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_mod2
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
x: Hacl.Spec.K256.Field52.Definitions.felem5 -> FStar.Pervasives.Lemma (ensures (let _ = x in (let FStar.Pervasives.Native.Mktuple5 #_ #_ #_ #_ #_ x0 _ _ _ _ = _ in Hacl.Spec.K256.Field52.Definitions.as_nat5 x % 2 = Lib.IntTypes.v x0 % 2) <: Type0))
{ "end_col": 35, "end_line": 26, "start_col": 25, "start_line": 18 }
FStar.Pervasives.Lemma
val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2
val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 =
false
null
true
lemma_as_nat_decompose f1; lemma_as_nat_decompose f2
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.felem5", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_decompose", "Prims.unit" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 1, "max_fuel": 0, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.as_nat_inj
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
f1: Hacl.Spec.K256.Field52.Definitions.felem5 -> f2: Hacl.Spec.K256.Field52.Definitions.felem5 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits5 f1 (1, 1, 1, 1, 1) /\ Hacl.Spec.K256.Field52.Definitions.felem_fits5 f2 (1, 1, 1, 1, 1) /\ Hacl.Spec.K256.Field52.Definitions.as_nat5 f1 == Hacl.Spec.K256.Field52.Definitions.as_nat5 f2) (ensures (let _ = f1 in (let FStar.Pervasives.Native.Mktuple5 #_ #_ #_ #_ #_ a0 a1 a2 a3 a4 = _ in let _ = f2 in (let FStar.Pervasives.Native.Mktuple5 #_ #_ #_ #_ #_ b0 b1 b2 b3 b4 = _ in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4) <: Type0) <: Type0))
{ "end_col": 27, "end_line": 188, "start_col": 2, "start_line": 187 }
FStar.Pervasives.Lemma
val lemma_small_sub_mod: a:nat -> n:pos -> Lemma (requires n <= a /\ a < 2 * n) (ensures a % n = a - n)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_small_sub_mod a n = calc (==) { a % n; (==) { Math.Lemmas.sub_div_mod_1 a n } (a - n) % n; (==) { Math.Lemmas.small_mod (a - n) n } a - n; }
val lemma_small_sub_mod: a:nat -> n:pos -> Lemma (requires n <= a /\ a < 2 * n) (ensures a % n = a - n) let lemma_small_sub_mod a n =
false
null
true
calc ( == ) { a % n; ( == ) { Math.Lemmas.sub_div_mod_1 a n } (a - n) % n; ( == ) { Math.Lemmas.small_mod (a - n) n } a - n; }
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Prims.nat", "Prims.pos", "FStar.Calc.calc_finish", "Prims.int", "Prims.eq2", "Prims.op_Modulus", "Prims.op_Subtraction", "Prims.Cons", "FStar.Preorder.relation", "Prims.Nil", "Prims.unit", "FStar.Calc.calc_step", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.sub_div_mod_1", "Prims.squash", "FStar.Math.Lemmas.small_mod" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1) val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52 m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; (==) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1)) val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52_last m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max48 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 48 12 } m1 * max48 + max48; (==) { Math.Lemmas.distributivity_add_left m1 1 max48 } (m1 + 1) * max48; }; Math.Lemmas.lemma_mult_le_right max48 (m1 + 1) 65536; assert_norm (65536 * max48 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits_last1 c (m1 + 1)) val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52 m1 m2 a b val lemma_carry_last52: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits_last1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry_last52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52_last m1 m2 a b val lemma_small_sub_mod: a:nat -> n:pos -> Lemma (requires n <= a /\ a < 2 * n) (ensures a % n = a - n)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_small_sub_mod: a:nat -> n:pos -> Lemma (requires n <= a /\ a < 2 * n) (ensures a % n = a - n)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_small_sub_mod
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
a: Prims.nat -> n: Prims.pos -> FStar.Pervasives.Lemma (requires n <= a /\ a < 2 * n) (ensures a % n = a - n)
{ "end_col": 3, "end_line": 335, "start_col": 2, "start_line": 329 }
FStar.Pervasives.Lemma
val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end
val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 =
false
null
true
if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else (lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48))
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint64", "Prims.op_LessThan", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.pow2", "FStar.Math.Lemmas.small_div", "Prims.bool", "Prims._assert", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Division", "Prims.unit", "FStar.Math.Lemmas.lemma_div_le", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_normalize_x_le_1" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_div_pow48
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
t4: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 t4 2) (ensures Lib.IntTypes.v t4 / Prims.pow2 48 == (match Lib.IntTypes.v t4 < Prims.pow2 48 with | true -> 0 | _ -> 1))
{ "end_col": 36, "end_line": 223, "start_col": 2, "start_line": 217 }
FStar.Pervasives.Lemma
val lemma_carry_last52: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits_last1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_carry_last52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52_last m1 m2 a b
val lemma_carry_last52: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits_last1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry_last52 m1 m2 a b =
false
null
true
lemma_mask52 b; lemma_add_rsh52_last m1 m2 a b
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.scale64_last", "Hacl.Spec.K256.Field52.Definitions.scale64", "Lib.IntTypes.uint64", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_add_rsh52_last", "Prims.unit", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_mask52" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1) val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52 m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; (==) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1)) val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52_last m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max48 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 48 12 } m1 * max48 + max48; (==) { Math.Lemmas.distributivity_add_left m1 1 max48 } (m1 + 1) * max48; }; Math.Lemmas.lemma_mult_le_right max48 (m1 + 1) 65536; assert_norm (65536 * max48 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits_last1 c (m1 + 1)) val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52 m1 m2 a b val lemma_carry_last52: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits_last1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_carry_last52: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits_last1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_carry_last52
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
m1: Hacl.Spec.K256.Field52.Definitions.scale64_last -> m2: Hacl.Spec.K256.Field52.Definitions.scale64 -> a: Lib.IntTypes.uint64 -> b: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 a m1 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. Hacl.Spec.K256.Field52.Definitions.mask52 in Hacl.Spec.K256.Field52.Definitions.felem_fits1 d 1 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 c (m1 + 1) /\ Lib.IntTypes.v d = Lib.IntTypes.v b % Prims.pow2 52 /\ Lib.IntTypes.v c = Lib.IntTypes.v a + Lib.IntTypes.v b / Prims.pow2 52))
{ "end_col": 32, "end_line": 321, "start_col": 2, "start_line": 320 }
FStar.Pervasives.Lemma
val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1)
val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a =
false
null
true
let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1)
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Hacl.Spec.K256.Field52.Definitions.felem_fits_last1", "Prims.unit", "Prims.op_Equality", "Prims.int", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.op_Modulus", "Prims.pow2", "Prims.eq2", "Lib.IntTypes.range_t", "Lib.IntTypes.mod_mask", "FStar.UInt32.__uint_to_t", "Hacl.Spec.K256.Field52.Definitions.mask48", "Lib.IntTypes.mod_mask_lemma", "FStar.Pervasives.assert_norm", "Prims.op_Subtraction", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Amp_Dot" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_mask48
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
a: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (ensures (let r = a &. Hacl.Spec.K256.Field52.Definitions.mask48 in Lib.IntTypes.v r = Lib.IntTypes.v a % Prims.pow2 48 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 r 1))
{ "end_col": 31, "end_line": 249, "start_col": 20, "start_line": 243 }
FStar.Pervasives.Lemma
val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_carry52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52 m1 m2 a b
val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry52 m1 m2 a b =
false
null
true
lemma_mask52 b; lemma_add_rsh52 m1 m2 a b
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.scale64", "Lib.IntTypes.uint64", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_add_rsh52", "Prims.unit", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_mask52" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1) val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52 m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; (==) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1)) val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52_last m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max48 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 48 12 } m1 * max48 + max48; (==) { Math.Lemmas.distributivity_add_left m1 1 max48 } (m1 + 1) * max48; }; Math.Lemmas.lemma_mult_le_right max48 (m1 + 1) 65536; assert_norm (65536 * max48 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits_last1 c (m1 + 1)) val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_carry52
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
m1: Hacl.Spec.K256.Field52.Definitions.scale64 -> m2: Hacl.Spec.K256.Field52.Definitions.scale64 -> a: Lib.IntTypes.uint64 -> b: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits1 a m1 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. Hacl.Spec.K256.Field52.Definitions.mask52 in Hacl.Spec.K256.Field52.Definitions.felem_fits1 d 1 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits1 c (m1 + 1) /\ Lib.IntTypes.v d = Lib.IntTypes.v b % Prims.pow2 52 /\ Lib.IntTypes.v c = Lib.IntTypes.v a + Lib.IntTypes.v b / Prims.pow2 52))
{ "end_col": 27, "end_line": 309, "start_col": 2, "start_line": 308 }
FStar.Pervasives.Lemma
val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1)
val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a =
false
null
true
let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1)
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Hacl.Spec.K256.Field52.Definitions.felem_fits1", "Prims.unit", "Prims.op_Equality", "Prims.int", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.op_Modulus", "Prims.pow2", "Prims.eq2", "Lib.IntTypes.range_t", "Lib.IntTypes.mod_mask", "FStar.UInt32.__uint_to_t", "Hacl.Spec.K256.Field52.Definitions.mask52", "Lib.IntTypes.mod_mask_lemma", "FStar.Pervasives.assert_norm", "Prims.op_Subtraction", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Amp_Dot" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_mask52
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
a: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (ensures (let r = a &. Hacl.Spec.K256.Field52.Definitions.mask52 in Lib.IntTypes.v r = Lib.IntTypes.v a % Prims.pow2 52 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits1 r 1))
{ "end_col": 26, "end_line": 236, "start_col": 20, "start_line": 230 }
FStar.Pervasives.Lemma
val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_add_rsh52 m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; (==) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1))
val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52 m1 m2 a b =
false
null
true
let c = a +. (b >>. 52ul) in calc ( < ) { v a + v b / pow2 52; ( < ) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; ( <= ) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; ( == ) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1))
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.scale64", "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Hacl.Spec.K256.Field52.Definitions.felem_fits1", "Prims.op_Addition", "Prims.unit", "Prims.op_Equality", "Prims.int", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.op_Division", "Prims.pow2", "FStar.Math.Lemmas.small_mod", "FStar.Pervasives.assert_norm", "Prims.op_LessThan", "FStar.Mul.op_Star", "Hacl.Spec.K256.Field52.Definitions.max52", "FStar.Math.Lemmas.lemma_mult_le_right", "FStar.Calc.calc_finish", "Prims.Cons", "FStar.Preorder.relation", "Prims.eq2", "Prims.op_LessThanOrEqual", "Prims.Nil", "FStar.Calc.calc_step", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.lemma_div_lt", "Prims.squash", "FStar.Math.Lemmas.pow2_lt_compat", "FStar.Math.Lemmas.distributivity_add_left", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Plus_Dot", "Lib.IntTypes.op_Greater_Greater_Dot", "FStar.UInt32.__uint_to_t" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1) val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_add_rsh52
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
m1: Hacl.Spec.K256.Field52.Definitions.scale64 -> m2: Hacl.Spec.K256.Field52.Definitions.scale64 -> a: Lib.IntTypes.uint64 -> b: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits1 a m1 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in Hacl.Spec.K256.Field52.Definitions.felem_fits1 c (m1 + 1) /\ Lib.IntTypes.v c = Lib.IntTypes.v a + Lib.IntTypes.v b / Prims.pow2 52))
{ "end_col": 33, "end_line": 273, "start_col": 31, "start_line": 257 }
FStar.Pervasives.Lemma
val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_add_rsh52_last m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max48 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 48 12 } m1 * max48 + max48; (==) { Math.Lemmas.distributivity_add_left m1 1 max48 } (m1 + 1) * max48; }; Math.Lemmas.lemma_mult_le_right max48 (m1 + 1) 65536; assert_norm (65536 * max48 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits_last1 c (m1 + 1))
val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52_last m1 m2 a b =
false
null
true
let c = a +. (b >>. 52ul) in calc ( < ) { v a + v b / pow2 52; ( < ) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max48 + pow2 12; ( <= ) { Math.Lemmas.pow2_lt_compat 48 12 } m1 * max48 + max48; ( == ) { Math.Lemmas.distributivity_add_left m1 1 max48 } (m1 + 1) * max48; }; Math.Lemmas.lemma_mult_le_right max48 (m1 + 1) 65536; assert_norm (65536 * max48 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits_last1 c (m1 + 1))
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.scale64_last", "Hacl.Spec.K256.Field52.Definitions.scale64", "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Hacl.Spec.K256.Field52.Definitions.felem_fits_last1", "Prims.op_Addition", "Prims.unit", "Prims.op_Equality", "Prims.int", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.op_Division", "Prims.pow2", "FStar.Math.Lemmas.small_mod", "FStar.Pervasives.assert_norm", "Prims.op_LessThan", "FStar.Mul.op_Star", "Hacl.Spec.K256.Field52.Definitions.max48", "FStar.Math.Lemmas.lemma_mult_le_right", "FStar.Calc.calc_finish", "Prims.Cons", "FStar.Preorder.relation", "Prims.eq2", "Prims.op_LessThanOrEqual", "Prims.Nil", "FStar.Calc.calc_step", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.lemma_div_lt", "Prims.squash", "FStar.Math.Lemmas.pow2_lt_compat", "FStar.Math.Lemmas.distributivity_add_left", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Plus_Dot", "Lib.IntTypes.op_Greater_Greater_Dot", "FStar.UInt32.__uint_to_t" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1) val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52 m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; (==) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1)) val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_add_rsh52_last
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
m1: Hacl.Spec.K256.Field52.Definitions.scale64_last -> m2: Hacl.Spec.K256.Field52.Definitions.scale64 -> a: Lib.IntTypes.uint64 -> b: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 a m1 /\ Hacl.Spec.K256.Field52.Definitions.felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 c (m1 + 1) /\ Lib.IntTypes.v c = Lib.IntTypes.v a + Lib.IntTypes.v b / Prims.pow2 52))
{ "end_col": 38, "end_line": 297, "start_col": 36, "start_line": 281 }
FStar.Pervasives.Lemma
val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1)
val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 =
false
null
true
calc ( == ) { (2 * (pow2 48 - 1)) / pow2 48; ( == ) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; ( == ) { Math.Lemmas.division_addition_lemma (- 2) (pow2 48) 2 } (- 2) / pow2 48 + 2; ( == ) { assert_norm ((- 2) / pow2 48 = - 1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1)
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Division", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.pow2", "Prims.unit", "FStar.Math.Lemmas.lemma_div_le", "Prims.op_Subtraction", "FStar.Mul.op_Star", "FStar.Calc.calc_finish", "Prims.int", "Prims.eq2", "Prims.Cons", "FStar.Preorder.relation", "Prims.Nil", "FStar.Calc.calc_step", "Prims.op_Addition", "Prims.op_Minus", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.distributivity_add_right", "Prims.squash", "FStar.Math.Lemmas.division_addition_lemma", "FStar.Pervasives.assert_norm", "Prims.op_Equality" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_normalize_x_le_1
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
t4: Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 t4 2) (ensures Lib.IntTypes.v t4 / Prims.pow2 48 <= 1)
{ "end_col": 30, "end_line": 209, "start_col": 2, "start_line": 197 }
FStar.Pervasives.Lemma
val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8
val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f =
false
null
true
let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.Sequence.lseq", "Lib.IntTypes.uint8", "Hacl.Spec.K256.MathLemmas.lemma_a_plus_b_pow2_mod2", "Lib.IntTypes.v", "Lib.IntTypes.U8", "Lib.IntTypes.SEC", "Lib.ByteSequence.nat_from_intseq_be", "Lib.Sequence.slice", "Prims.unit", "Prims._assert", "Prims.eq2", "Prims.int", "Prims.op_Addition", "FStar.Mul.op_Star", "Prims.pow2", "Lib.ByteSequence.nat_from_intseq_be_lemma0", "Lib.ByteSequence.nat_from_intseq_be_slice_lemma", "Lib.IntTypes.int_t", "FStar.Seq.Base.index", "Lib.Sequence.to_seq", "Lib.Sequence.index" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_nat_from_bytes_be_mod2
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
f: Lib.Sequence.lseq Lib.IntTypes.uint8 32 -> FStar.Pervasives.Lemma (ensures Lib.ByteSequence.nat_from_bytes_be f % 2 = Lib.IntTypes.v (Lib.Sequence.index f 31) % 2 )
{ "end_col": 84, "end_line": 37, "start_col": 36, "start_line": 32 }
FStar.Pervasives.Lemma
val carry_last_small_mod_lemma: t4:uint64 -> t3':uint64 -> Lemma (requires felem_fits_last1 t4 1 /\ v (t4 +. (t3' >>. 52ul)) == v t4 + v t3' / pow2 52) (ensures (let r = t4 +. (t3' >>. 52ul) in felem_fits_last1 r 2 /\ v r < v t4 + pow2 12 /\ (v r >= pow2 48 ==> v r % pow2 48 < pow2 12)))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let carry_last_small_mod_lemma t4 t3' = let r = t4 +. (t3' >>. 52ul) in assert (v r = v t4 + v t3' / pow2 52); Math.Lemmas.lemma_div_lt (v t3') 64 52; assert (v r < v t4 + pow2 12); Math.Lemmas.pow2_lt_compat 48 12; assert (felem_fits_last1 r 2); if v r >= pow2 48 then begin lemma_small_sub_mod (v r) (pow2 48); assert (v r % pow2 48 = v r - pow2 48); assert (v r % pow2 48 < pow2 12) end
val carry_last_small_mod_lemma: t4:uint64 -> t3':uint64 -> Lemma (requires felem_fits_last1 t4 1 /\ v (t4 +. (t3' >>. 52ul)) == v t4 + v t3' / pow2 52) (ensures (let r = t4 +. (t3' >>. 52ul) in felem_fits_last1 r 2 /\ v r < v t4 + pow2 12 /\ (v r >= pow2 48 ==> v r % pow2 48 < pow2 12))) let carry_last_small_mod_lemma t4 t3' =
false
null
true
let r = t4 +. (t3' >>. 52ul) in assert (v r = v t4 + v t3' / pow2 52); Math.Lemmas.lemma_div_lt (v t3') 64 52; assert (v r < v t4 + pow2 12); Math.Lemmas.pow2_lt_compat 48 12; assert (felem_fits_last1 r 2); if v r >= pow2 48 then (lemma_small_sub_mod (v r) (pow2 48); assert (v r % pow2 48 = v r - pow2 48); assert (v r % pow2 48 < pow2 12))
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint64", "Prims.op_GreaterThanOrEqual", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.pow2", "Prims._assert", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Modulus", "Prims.unit", "Prims.op_Equality", "Prims.int", "Prims.op_Subtraction", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_small_sub_mod", "Prims.bool", "Hacl.Spec.K256.Field52.Definitions.felem_fits_last1", "FStar.Math.Lemmas.pow2_lt_compat", "Prims.op_Addition", "FStar.Math.Lemmas.lemma_div_lt", "Prims.op_Division", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Plus_Dot", "Lib.IntTypes.op_Greater_Greater_Dot", "FStar.UInt32.__uint_to_t" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52) #push-options "--ifuel 1" val as_nat_inj (f1 f2: felem5) : Lemma (requires felem_fits5 f1 (1,1,1,1,1) /\ felem_fits5 f2 (1,1,1,1,1) /\ as_nat5 f1 == as_nat5 f2) (ensures (let (a0,a1,a2,a3,a4) = f1 in let (b0,b1,b2,b3,b4) = f2 in a0 == b0 /\ a1 == b1 /\ a2 == b2 /\ a3 == b3 /\ a4 == b4)) let as_nat_inj f1 f2 = lemma_as_nat_decompose f1; lemma_as_nat_decompose f2 #pop-options val lemma_normalize_x_le_1: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 <= 1) let lemma_normalize_x_le_1 t4 = calc (==) { (2 * (pow2 48 - 1)) / pow2 48; (==) { Math.Lemmas.distributivity_add_right 2 (pow2 48) 1 } (2 * pow2 48 - 2) / pow2 48; (==) { Math.Lemmas.division_addition_lemma (-2) (pow2 48) 2 } (-2) / pow2 48 + 2; (==) { assert_norm ((-2) / pow2 48 = -1) } 1; }; assert (v t4 <= 2 * (pow2 48 - 1)); Math.Lemmas.lemma_div_le (v t4) (2 * pow2 48 - 2) (pow2 48); assert (v t4 / pow2 48 <= 1) val lemma_div_pow48: t4:uint64 -> Lemma (requires felem_fits_last1 t4 2) (ensures v t4 / pow2 48 == (if v t4 < pow2 48 then 0 else 1)) let lemma_div_pow48 t4 = if v t4 < pow2 48 then Math.Lemmas.small_div (v t4) (pow2 48) else begin lemma_normalize_x_le_1 t4; assert (v t4 / pow2 48 <= 1); Math.Lemmas.lemma_div_le (pow2 48) (v t4) (pow2 48); assert (1 <= v t4 / pow2 48) end val lemma_mask52: a:uint64 -> Lemma (let r = a &. mask52 in v r = v a % pow2 52 /\ felem_fits1 r 1) let lemma_mask52 a = let r = a &. mask52 in assert_norm (v mask52 = pow2 52 - 1); mod_mask_lemma a 52ul; assert (v (mod_mask #U64 #SEC 52ul) == v mask52); assert (v r = v a % pow2 52); assert (felem_fits1 r 1) val lemma_mask48: a:uint64 -> Lemma (let r = a &. mask48 in v r = v a % pow2 48 /\ felem_fits_last1 r 1) let lemma_mask48 a = let r = a &. mask48 in assert_norm (v mask48 = pow2 48 - 1); mod_mask_lemma a 48ul; assert (v (mod_mask #U64 #SEC 48ul) == v mask48); assert (v r = v a % pow2 48); assert (felem_fits_last1 r 1) val lemma_add_rsh52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in felem_fits1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52 m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max52 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 52 12 } m1 * max52 + max52; (==) { Math.Lemmas.distributivity_add_left m1 1 max52 } (m1 + 1) * max52; }; Math.Lemmas.lemma_mult_le_right max52 (m1 + 1) 4096; assert_norm (4096 * max52 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits1 c (m1 + 1)) val lemma_add_rsh52_last: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in felem_fits_last1 c (m1 + 1) /\ v c = v a + v b / pow2 52)) let lemma_add_rsh52_last m1 m2 a b = let c = a +. (b >>. 52ul) in calc (<) { v a + v b / pow2 52; (<) { Math.Lemmas.lemma_div_lt (v b) 64 52 } m1 * max48 + pow2 12; (<=) { Math.Lemmas.pow2_lt_compat 48 12 } m1 * max48 + max48; (==) { Math.Lemmas.distributivity_add_left m1 1 max48 } (m1 + 1) * max48; }; Math.Lemmas.lemma_mult_le_right max48 (m1 + 1) 65536; assert_norm (65536 * max48 < pow2 64); Math.Lemmas.small_mod (v a + v b / pow2 52) (pow2 64); assert (v c = v a + v b / pow2 52); assert (felem_fits_last1 c (m1 + 1)) val lemma_carry52: m1:scale64 -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 4096) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52 m1 m2 a b val lemma_carry_last52: m1:scale64_last -> m2:scale64 -> a:uint64 -> b:uint64 -> Lemma (requires felem_fits_last1 a m1 /\ felem_fits1 b m2 /\ m1 + 1 <= 65536) (ensures (let c = a +. (b >>. 52ul) in let d = b &. mask52 in felem_fits1 d 1 /\ felem_fits_last1 c (m1 + 1) /\ v d = v b % pow2 52 /\ v c = v a + v b / pow2 52)) let lemma_carry_last52 m1 m2 a b = lemma_mask52 b; lemma_add_rsh52_last m1 m2 a b val lemma_small_sub_mod: a:nat -> n:pos -> Lemma (requires n <= a /\ a < 2 * n) (ensures a % n = a - n) let lemma_small_sub_mod a n = calc (==) { a % n; (==) { Math.Lemmas.sub_div_mod_1 a n } (a - n) % n; (==) { Math.Lemmas.small_mod (a - n) n } a - n; } val carry_last_small_mod_lemma: t4:uint64 -> t3':uint64 -> Lemma (requires felem_fits_last1 t4 1 /\ v (t4 +. (t3' >>. 52ul)) == v t4 + v t3' / pow2 52) (ensures (let r = t4 +. (t3' >>. 52ul) in felem_fits_last1 r 2 /\ v r < v t4 + pow2 12 /\ (v r >= pow2 48 ==> v r % pow2 48 < pow2 12)))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val carry_last_small_mod_lemma: t4:uint64 -> t3':uint64 -> Lemma (requires felem_fits_last1 t4 1 /\ v (t4 +. (t3' >>. 52ul)) == v t4 + v t3' / pow2 52) (ensures (let r = t4 +. (t3' >>. 52ul) in felem_fits_last1 r 2 /\ v r < v t4 + pow2 12 /\ (v r >= pow2 48 ==> v r % pow2 48 < pow2 12)))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.carry_last_small_mod_lemma
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
t4: Lib.IntTypes.uint64 -> t3': Lib.IntTypes.uint64 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 t4 1 /\ Lib.IntTypes.v (t4 +. (t3' >>. 52ul)) == Lib.IntTypes.v t4 + Lib.IntTypes.v t3' / Prims.pow2 52) (ensures (let r = t4 +. (t3' >>. 52ul) in Hacl.Spec.K256.Field52.Definitions.felem_fits_last1 r 2 /\ Lib.IntTypes.v r < Lib.IntTypes.v t4 + Prims.pow2 12 /\ (Lib.IntTypes.v r >= Prims.pow2 48 ==> Lib.IntTypes.v r % Prims.pow2 48 < Prims.pow2 12)))
{ "end_col": 40, "end_line": 356, "start_col": 39, "start_line": 345 }
FStar.Pervasives.Lemma
val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0
val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b =
false
null
true
let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Lib.Sequence.lseq", "Lib.IntTypes.uint64", "Hacl.Spec.K256.MathLemmas.lemma_as_nat64_horner", "Prims.unit", "Prims._assert", "Prims.eq2", "Prims.int", "Prims.op_Addition", "FStar.Mul.op_Star", "Prims.pow2", "Lib.ByteSequence.nat_from_intseq_be_lemma0", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "FStar.Seq.Base.slice", "Lib.ByteSequence.nat_from_intseq_be", "Lib.ByteSequence.nat_from_intseq_be_slice_lemma", "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Multiply", "Lib.Sequence.length", "Lib.IntTypes.int_t", "Lib.IntTypes.range", "Lib.IntTypes.v", "Lib.Sequence.index" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.unfold_nat_from_uint64_four
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
b: Lib.Sequence.lseq Lib.IntTypes.uint64 4 -> FStar.Pervasives.Lemma (ensures Lib.ByteSequence.nat_from_intseq_be b == Lib.IntTypes.v (Lib.Sequence.index b 3) + Lib.IntTypes.v (Lib.Sequence.index b 2) * Prims.pow2 64 + Lib.IntTypes.v (Lib.Sequence.index b 1) * Prims.pow2 128 + Lib.IntTypes.v (Lib.Sequence.index b 0) * Prims.pow2 192)
{ "end_col": 38, "end_line": 66, "start_col": 35, "start_line": 45 }
FStar.Pervasives.Lemma
val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52))
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_as_nat_decompose f = let (f0,f1,f2,f3,f4) = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52)
val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52)) let lemma_as_nat_decompose f =
false
null
true
let f0, f1, f2, f3, f4 = f in lemma_as_nat_bound f; Math.Lemmas.euclidean_division_definition (as_nat5 f) pow208; assert (v f4 = as_nat5 f / pow208); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow208) pow156; assert (v f3 = as_nat5 f % pow208 / pow156); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 156 208; assert (as_nat5 f % pow208 % pow156 == as_nat5 f % pow156); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow156) pow104; assert (v f2 = as_nat5 f % pow156 / pow104); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 104 156; assert (as_nat5 f % pow156 % pow104 == as_nat5 f % pow104); Math.Lemmas.euclidean_division_definition (as_nat5 f % pow104) pow52; assert (v f1 = as_nat5 f % pow104 / pow52); Math.Lemmas.pow2_modulo_modulo_lemma_1 (as_nat5 f) 52 104; assert (as_nat5 f % pow104 % pow52 == as_nat5 f % pow52); assert (v f0 = as_nat5 f % pow52)
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.felem5", "Lib.IntTypes.uint64", "Prims._assert", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Prims.op_Modulus", "Hacl.Spec.K256.Field52.Definitions.as_nat5", "Hacl.Spec.K256.Field52.Definitions.pow52", "Prims.unit", "Prims.eq2", "Hacl.Spec.K256.Field52.Definitions.pow104", "FStar.Math.Lemmas.pow2_modulo_modulo_lemma_1", "Prims.op_Division", "FStar.Math.Lemmas.euclidean_division_definition", "Hacl.Spec.K256.Field52.Definitions.pow156", "Hacl.Spec.K256.Field52.Definitions.pow208", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_bound" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; } val lemma_as_nat_bound: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures as_nat5 f < pow2 256) let lemma_as_nat_bound f = lemma_as_nat_bound_f4_lt_powa f 48 val lemma_as_nat_bound_f4_lt_pow12: f:felem5 -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 12)) (ensures as_nat5 f <= pow2 220 - 1) let lemma_as_nat_bound_f4_lt_pow12 f = lemma_as_nat_bound_f4_lt_powa f 12 val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52))
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_as_nat_decompose: f:felem5 -> Lemma (requires felem_fits5 f (1,1,1,1,1)) (ensures (let (f0,f1,f2,f3,f4) = f in v f4 = as_nat5 f / pow208 /\ v f3 = as_nat5 f % pow208 / pow156 /\ v f2 = as_nat5 f % pow156 / pow104 /\ v f1 = as_nat5 f % pow104 / pow52 /\ v f0 = as_nat5 f % pow52))
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_decompose
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
f: Hacl.Spec.K256.Field52.Definitions.felem5 -> FStar.Pervasives.Lemma (requires Hacl.Spec.K256.Field52.Definitions.felem_fits5 f (1, 1, 1, 1, 1)) (ensures (let _ = f in (let FStar.Pervasives.Native.Mktuple5 #_ #_ #_ #_ #_ f0 f1 f2 f3 f4 = _ in Lib.IntTypes.v f4 = Hacl.Spec.K256.Field52.Definitions.as_nat5 f / Hacl.Spec.K256.Field52.Definitions.pow208 /\ Lib.IntTypes.v f3 = Hacl.Spec.K256.Field52.Definitions.as_nat5 f % Hacl.Spec.K256.Field52.Definitions.pow208 / Hacl.Spec.K256.Field52.Definitions.pow156 /\ Lib.IntTypes.v f2 = Hacl.Spec.K256.Field52.Definitions.as_nat5 f % Hacl.Spec.K256.Field52.Definitions.pow156 / Hacl.Spec.K256.Field52.Definitions.pow104 /\ Lib.IntTypes.v f1 = Hacl.Spec.K256.Field52.Definitions.as_nat5 f % Hacl.Spec.K256.Field52.Definitions.pow104 / Hacl.Spec.K256.Field52.Definitions.pow52 /\ Lib.IntTypes.v f0 = Hacl.Spec.K256.Field52.Definitions.as_nat5 f % Hacl.Spec.K256.Field52.Definitions.pow52) <: Type0))
{ "end_col": 35, "end_line": 174, "start_col": 30, "start_line": 152 }
FStar.Pervasives.Lemma
val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; }
val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () =
false
null
true
calc ( == ) { pow2 260 % S.prime; ( == ) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; ( == ) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; ( == ) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; ( == ) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; ( == ) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; }
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Prims.unit", "FStar.Calc.calc_finish", "Prims.int", "Prims.eq2", "Prims.op_Modulus", "Prims.pow2", "Spec.K256.PointOps.prime", "Prims.Cons", "FStar.Preorder.relation", "Prims.Nil", "FStar.Calc.calc_step", "FStar.Mul.op_Star", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.pow2_plus", "Prims.squash", "FStar.Math.Lemmas.lemma_mod_mul_distr_l", "Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_prime", "FStar.Pervasives.assert_norm", "Prims.b2t", "Prims.op_Equality", "FStar.Math.Lemmas.small_mod" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_pow2_260_mod_prime
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
_: Prims.unit -> FStar.Pervasives.Lemma (ensures Prims.pow2 260 % Spec.K256.PointOps.prime = 0x1000003D10)
{ "end_col": 3, "end_line": 89, "start_col": 2, "start_line": 77 }
FStar.Pervasives.Lemma
val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1)
[ { "abbrev": true, "full_module": "Hacl.Spec.K256.MathLemmas", "short_module": "ML" }, { "abbrev": true, "full_module": "Spec.K256", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.K256.Field52.Definitions", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_as_nat_bound_f4_lt_powa f a = let (f0,f1,f2,f3,f4) = f in calc (<=) { //as_nat5 f == v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; (<=) { Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52 } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52 } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104 } pow2 52 * pow156 + v f4 * pow208 - 1; (<=) { Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208 } pow2 (208 + a) - 1; }
val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1) let lemma_as_nat_bound_f4_lt_powa f a =
false
null
true
let f0, f1, f2, f3, f4 = f in calc ( <= ) { v f0 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; ( <= ) { () } pow2 52 - 1 + v f1 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208; ( <= ) { (Math.Lemmas.lemma_mult_le_right pow52 (v f1) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow52) } pow2 52 * pow52 + v f2 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; ( <= ) { (Math.Lemmas.lemma_mult_le_right pow104 (v f2) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow104; Math.Lemmas.pow2_plus 52 52) } pow2 52 * pow104 + v f3 * pow156 + v f4 * pow208 - 1; ( <= ) { (Math.Lemmas.lemma_mult_le_right pow156 (v f3) (pow2 52 - 1); Math.Lemmas.distributivity_sub_left (pow2 52) 1 pow156; Math.Lemmas.pow2_plus 52 104) } pow2 52 * pow156 + v f4 * pow208 - 1; ( <= ) { (Math.Lemmas.lemma_mult_le_right pow208 (v f4) (pow2 a - 1); Math.Lemmas.distributivity_sub_left (pow2 a) 1 pow208; Math.Lemmas.pow2_plus 52 156; Math.Lemmas.pow2_plus a 208) } pow2 (208 + a) - 1; }
{ "checked_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked", "dependencies": [ "Spec.K256.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Hacl.Spec.K256.MathLemmas.fst.checked", "Hacl.Spec.K256.Field52.Definitions.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.K256.Field52.Definitions.Lemmas.fst" }
[ "lemma" ]
[ "Hacl.Spec.K256.Field52.Definitions.felem5", "Prims.nat", "Lib.IntTypes.uint64", "FStar.Calc.calc_finish", "Prims.int", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.v", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "FStar.Mul.op_Star", "Hacl.Spec.K256.Field52.Definitions.pow52", "Hacl.Spec.K256.Field52.Definitions.pow104", "Hacl.Spec.K256.Field52.Definitions.pow156", "Hacl.Spec.K256.Field52.Definitions.pow208", "Prims.op_Subtraction", "Prims.pow2", "Prims.Cons", "FStar.Preorder.relation", "Prims.Nil", "Prims.unit", "FStar.Calc.calc_step", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "Prims.squash", "FStar.Math.Lemmas.distributivity_sub_left", "FStar.Math.Lemmas.lemma_mult_le_right", "FStar.Math.Lemmas.pow2_plus" ]
[]
module Hacl.Spec.K256.Field52.Definitions.Lemmas open FStar.Mul open Lib.IntTypes open Hacl.Spec.K256.Field52.Definitions module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence module S = Spec.K256 module ML = Hacl.Spec.K256.MathLemmas #set-options "--z3rlimit 100 --fuel 0 --ifuel 0" val lemma_as_nat_mod2: x:felem5 -> Lemma (let (x0,x1,x2,x3,x4) = x in as_nat5 x % 2 = v x0 % 2) let lemma_as_nat_mod2 x = let (x0,x1,x2,x3,x4) = x in assert (as_nat5 x = v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208); assert (as_nat5 x % 2 = (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156 + v x4 * pow208) % 2); ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104 + v x3 * pow156) (v x4) 208; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52 + v x2 * pow104) (v x3) 156; ML.lemma_a_plus_b_pow2_mod2 (v x0 + v x1 * pow52) (v x2) 104; ML.lemma_a_plus_b_pow2_mod2 (v x0) (v x1) 52; assert (as_nat5 x % 2 = v x0 % 2) val lemma_nat_from_bytes_be_mod2: f:LSeq.lseq uint8 32 -> Lemma (BSeq.nat_from_bytes_be f % 2 = v (LSeq.index f 31) % 2) let lemma_nat_from_bytes_be_mod2 f = let x0 = LSeq.index f 31 in BSeq.nat_from_intseq_be_slice_lemma f 31; BSeq.nat_from_intseq_be_lemma0 (LSeq.slice f 31 32); assert (BSeq.nat_from_intseq_be f == v x0 + pow2 8 * BSeq.nat_from_intseq_be (LSeq.slice f 0 31)); ML.lemma_a_plus_b_pow2_mod2 (v x0) (BSeq.nat_from_intseq_be (LSeq.slice f 0 31)) 8 val unfold_nat_from_uint64_four: b:LSeq.lseq uint64 4 -> Lemma (BSeq.nat_from_intseq_be b == v (LSeq.index b 3) + v (LSeq.index b 2) * pow2 64 + v (LSeq.index b 1) * pow2 128 + v (LSeq.index b 0) * pow2 192) let unfold_nat_from_uint64_four b = let b0 = v (LSeq.index b 0) in let b1 = v (LSeq.index b 1) in let b2 = v (LSeq.index b 2) in let b3 = v (LSeq.index b 3) in let res = BSeq.nat_from_intseq_be b in BSeq.nat_from_intseq_be_slice_lemma b 3; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 3 4); assert (res == b3 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 3))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #3 (Seq.slice b 0 3) 2; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 2 3); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 3) == b2 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 2))); BSeq.nat_from_intseq_be_slice_lemma #U64 #SEC #2 (Seq.slice b 0 2) 1; BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 1 2); assert (BSeq.nat_from_intseq_be (Seq.slice b 0 2) == b1 + pow2 64 * (BSeq.nat_from_intseq_be (Seq.slice b 0 1))); BSeq.nat_from_intseq_be_lemma0 (Seq.slice b 0 1); assert (res == b3 + pow2 64 * (b2 + pow2 64 * (b1 + pow2 64 * b0))); ML.lemma_as_nat64_horner b3 b2 b1 b0 val lemma_prime : unit -> Lemma (pow2 256 % S.prime = 0x1000003D1) let lemma_prime () = () val lemma_pow2_256_minus_prime : unit -> Lemma (pow2 256 - S.prime = 0x1000003D1) let lemma_pow2_256_minus_prime () = () val lemma_pow2_260_mod_prime: unit -> Lemma (pow2 260 % S.prime = 0x1000003D10) let lemma_pow2_260_mod_prime () = calc (==) { pow2 260 % S.prime; (==) { Math.Lemmas.pow2_plus 256 4 } pow2 256 * pow2 4 % S.prime; (==) { Math.Lemmas.lemma_mod_mul_distr_l (pow2 256) (pow2 4) S.prime } (pow2 256 % S.prime) * pow2 4 % S.prime; (==) { lemma_prime () } 0x1000003D1 * pow2 4 % S.prime; (==) { assert_norm (0x1000003D1 * pow2 4 = 0x1000003D10) } 0x1000003D10 % S.prime; (==) { Math.Lemmas.small_mod 0x1000003D10 S.prime } 0x1000003D10; } val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1)
false
false
Hacl.Spec.K256.Field52.Definitions.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_as_nat_bound_f4_lt_powa: f:felem5 -> a:nat -> Lemma (requires (let (f0,f1,f2,f3,f4) = f in felem_fits5 f (1,1,1,1,1) /\ v f4 < pow2 a)) (ensures as_nat5 f <= pow2 (208 + a) - 1)
[]
Hacl.Spec.K256.Field52.Definitions.Lemmas.lemma_as_nat_bound_f4_lt_powa
{ "file_name": "code/k256/Hacl.Spec.K256.Field52.Definitions.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
f: Hacl.Spec.K256.Field52.Definitions.felem5 -> a: Prims.nat -> FStar.Pervasives.Lemma (requires (let _ = f in (let FStar.Pervasives.Native.Mktuple5 #_ #_ #_ #_ #_ _ _ _ _ f4 = _ in Hacl.Spec.K256.Field52.Definitions.felem_fits5 f (1, 1, 1, 1, 1) /\ Lib.IntTypes.v f4 < Prims.pow2 a) <: Type0)) (ensures Hacl.Spec.K256.Field52.Definitions.as_nat5 f <= Prims.pow2 (208 + a) - 1)
{ "end_col": 5, "end_line": 123, "start_col": 39, "start_line": 97 }