file_name
stringlengths
5
52
name
stringlengths
4
95
original_source_type
stringlengths
0
23k
source_type
stringlengths
9
23k
source_definition
stringlengths
9
57.9k
source
dict
source_range
dict
file_context
stringlengths
0
721k
dependencies
dict
opens_and_abbrevs
listlengths
2
94
vconfig
dict
interleaved
bool
1 class
verbose_type
stringlengths
1
7.42k
effect
stringclasses
118 values
effect_flags
sequencelengths
0
2
mutual_with
sequencelengths
0
11
ideal_premises
sequencelengths
0
236
proof_features
sequencelengths
0
1
is_simple_lemma
bool
2 classes
is_div
bool
2 classes
is_proof
bool
2 classes
is_simply_typed
bool
2 classes
is_type
bool
2 classes
partial_definition
stringlengths
5
3.99k
completed_definiton
stringlengths
1
1.63M
isa_cross_project_example
bool
1 class
Hacl.Impl.FFDHE.Constants.fst
Hacl.Impl.FFDHE.Constants.ffdhe_g2
val ffdhe_g2:x: glbuffer pub_uint8 1ul {witnessed x S.ffdhe_g2 /\ recallable x}
val ffdhe_g2:x: glbuffer pub_uint8 1ul {witnessed x S.ffdhe_g2 /\ recallable x}
let ffdhe_g2 :x:glbuffer pub_uint8 1ul{witnessed x S.ffdhe_g2 /\ recallable x} = createL_global S.list_ffdhe_g2
{ "file_name": "code/ffdhe/Hacl.Impl.FFDHE.Constants.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 32, "end_line": 16, "start_col": 0, "start_line": 15 }
module Hacl.Impl.FFDHE.Constants open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module S = Spec.FFDHE #set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
{ "checked_file": "/", "dependencies": [ "Spec.FFDHE.fst.checked", "prims.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.Buffer.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.FFDHE.Constants.fst" }
[ { "abbrev": true, "full_module": "Spec.FFDHE", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.FFDHE", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.FFDHE", "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 } ]
{ "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
x: (c: Lib.Buffer.lbuffer_t Lib.Buffer.CONST (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) (1ul <: FStar.UInt32.t) {LowStar.ConstBuffer.qual_of c == LowStar.ConstBuffer.IMMUTABLE}) {Lib.Buffer.witnessed x Spec.FFDHE.ffdhe_g2 /\ Lib.Buffer.recallable x}
Prims.Tot
[ "total" ]
[]
[ "Lib.Buffer.createL_global", "Lib.IntTypes.int_t", "Lib.IntTypes.U8", "Lib.IntTypes.PUB", "Spec.FFDHE.list_ffdhe_g2", "Lib.Buffer.glbuffer", "Lib.IntTypes.size", "FStar.Pervasives.normalize_term", "Lib.IntTypes.size_nat", "FStar.List.Tot.Base.length" ]
[]
false
false
false
false
false
let ffdhe_g2:x: glbuffer pub_uint8 1ul {witnessed x S.ffdhe_g2 /\ recallable x} =
createL_global S.list_ffdhe_g2
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Add64Wrap
val va_codegen_success_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Add64Wrap dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 110, "start_col": 0, "start_line": 109 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_AddLea64
val va_codegen_success_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 140, "start_col": 0, "start_line": 139 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src1: Vale.X64.Decls.va_operand_opr64 -> src2: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_AddLea64
val va_code_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> Tot va_code
val va_code_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> Tot va_code
let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 54, "end_line": 136, "start_col": 0, "start_line": 135 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src1: Vale.X64.Decls.va_operand_opr64 -> src2: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_AddLea64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Add64Wrap
val va_code_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 106, "start_col": 0, "start_line": 105 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Add64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Adc64
val va_code_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 50, "end_line": 165, "start_col": 0, "start_line": 164 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_AddCarry64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Adc64
val va_codegen_success_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adc64 dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 169, "start_col": 0, "start_line": 168 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Adc64Wrap
val va_code_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 50, "end_line": 195, "start_col": 0, "start_line": 194 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_AddCarry64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Adc64Wrap
val va_codegen_success_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adc64Wrap dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 199, "start_col": 0, "start_line": 198 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Adcx64Wrap
val va_codegen_success_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 230, "start_col": 0, "start_line": 229 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "boxwrap", "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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Adcx64Wrap
val va_code_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 226, "start_col": 0, "start_line": 225 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap"
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "boxwrap", "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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Adcx64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Adox64Wrap
val va_code_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 261, "start_col": 0, "start_line": 260 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsOf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Adox64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Adox64Wrap
val va_codegen_success_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adox64Wrap dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 265, "start_col": 0, "start_line": 264 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
false
Pulse.Lib.Array.fst
Pulse.Lib.Array.zeroize
val zeroize (l:SZ.t) (a:array U8.t{ SZ.v l == length a }) (#s:Ghost.erased (Seq.seq U8.t)) : stt unit (requires pts_to a s) (ensures fun _ -> exists* (s:Seq.seq U8.t). pts_to a s ** pure (s `Seq.equal` Seq.create (SZ.v l) 0uy))
val zeroize (l:SZ.t) (a:array U8.t{ SZ.v l == length a }) (#s:Ghost.erased (Seq.seq U8.t)) : stt unit (requires pts_to a s) (ensures fun _ -> exists* (s:Seq.seq U8.t). pts_to a s ** pure (s `Seq.equal` Seq.create (SZ.v l) 0uy))
let zeroize = zeroize'
{ "file_name": "share/steel/examples/pulse/lib/Pulse.Lib.Array.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 22, "end_line": 136, "start_col": 0, "start_line": 136 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Lib.Array module PM = Pulse.Main open Pulse.Lib.Core open Pulse.Lib.Reference open Pulse.Lib.Array.Core open FStar.Ghost module US = FStar.SizeT module U8 = FStar.UInt8 open Pulse.Lib.BoundedIntegers module A = Pulse.Lib.Array.Core module R = Pulse.Lib.Reference ```pulse fn compare' (#t:eqtype) (l:US.t) (a1 a2:larray t (US.v l)) requires pts_to a1 #p1 's1 ** pts_to a2 #p2 's2 returns res:bool ensures pts_to a1 #p1 's1 ** pts_to a2 #p2 's2 ** (pure (res <==> Seq.equal 's1 's2)) { pts_to_len a1 #p1 #'s1; pts_to_len a2 #p2 #'s2; let mut i = 0sz; while (let vi = !i; if (vi < l) { let v1 = a1.(vi); let v2 = a2.(vi); (v1 = v2) } else { false } ) invariant b. exists* (vi:US.t). ( R.pts_to i vi ** A.pts_to a1 #p1 's1 ** A.pts_to a2 #p2 's2 ** pure (vi <= l /\ (b == (vi < l && Seq.index 's1 (US.v vi) = Seq.index 's2 (US.v vi))) /\ (forall (i:nat). i < US.v vi ==> Seq.index 's1 i == Seq.index 's2 i))) { let vi = !i; i := vi + 1sz; }; let vi = !i; let res = vi = l; res } ``` let compare = compare' ```pulse fn memcpy' (#t:eqtype) (l:US.t) (src dst:larray t (US.v l)) (#p:perm) (#src0 #dst0:Ghost.erased (Seq.seq t)) requires A.pts_to src #p src0 ** A.pts_to dst dst0 ensures A.pts_to src #p src0 ** A.pts_to dst src0 { pts_to_len src #p #src0; pts_to_len dst #full_perm #dst0; let mut i = 0sz; while (let vi = !i; (vi < l) ) invariant b. exists* (vi:US.t) (s:Seq.seq t). ( R.pts_to i vi ** A.pts_to src #p src0 ** A.pts_to dst s ** pure (vi <= l /\ Seq.length s == US.v l /\ (b == (vi < l)) /\ (forall (i:nat). i < US.v vi ==> Seq.index src0 i == Seq.index s i))) { let vi = !i; let x = src.(vi); with s. assert (A.pts_to dst s); (dst.(vi) <- x); i := vi + 1sz; }; with s. assert (A.pts_to dst s); Seq.lemma_eq_elim src0 s; () } ``` let memcpy = memcpy' ```pulse fn fill' (#t:Type0) (l:US.t) (a:larray t (US.v l)) (v:t) requires A.pts_to a 's ensures exists* (s:Seq.seq t). A.pts_to a s ** pure (s `Seq.equal` Seq.create (US.v l) v) { pts_to_len a #full_perm #'s; let mut i = 0sz; while (let vi = !i; (vi < l)) invariant b. exists* (vi:US.t) (s:Seq.seq t). ( R.pts_to i vi ** A.pts_to a s ** pure (vi <= l /\ Seq.length s == US.v l /\ (b == (vi < l)) /\ (forall (i:nat). i < US.v vi ==> Seq.index s i == v))) { let vi = !i; (a.(vi) <- v); i := vi + 1sz; } } ``` let fill = fill' ```pulse fn zeroize' (l:US.t) (a:larray U8.t (US.v l)) requires A.pts_to a 's ensures exists* (s:Seq.seq U8.t). A.pts_to a s ** pure (s `Seq.equal` Seq.create (US.v l) 0uy) { pts_to_len a #full_perm #'s; fill' l a 0uy }
{ "checked_file": "/", "dependencies": [ "Pulse.Main.fsti.checked", "Pulse.Lib.Reference.fsti.checked", "Pulse.Lib.Core.fsti.checked", "Pulse.Lib.BoundedIntegers.fst.checked", "Pulse.Lib.Array.Core.fsti.checked", "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.SizeT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Lib.Array.fst" }
[ { "abbrev": true, "full_module": "Pulse.Lib.Reference", "short_module": "R" }, { "abbrev": true, "full_module": "Pulse.Lib.Array.Core", "short_module": "A" }, { "abbrev": false, "full_module": "Pulse.Lib.BoundedIntegers", "short_module": null }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": false, "full_module": "Pulse.Lib.Reference", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Main", "short_module": "PM" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.Seq", "short_module": "Seq" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "SZ" }, { "abbrev": false, "full_module": "Pulse.Lib.Array.Core", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "PulseCore.FractionalPermission", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Lib.Array.Core", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Lib.Core", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Lib", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Lib", "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 } ]
{ "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" }
false
l: FStar.SizeT.t -> a: Pulse.Lib.Array.Core.array FStar.UInt8.t {FStar.SizeT.v l == Pulse.Lib.Array.Core.length a} -> Pulse.Lib.Core.stt Prims.unit (Pulse.Lib.Array.Core.pts_to a (FStar.Ghost.reveal s)) (fun _ -> exists* (s: FStar.Seq.Base.seq FStar.UInt8.t). Pulse.Lib.Array.Core.pts_to a s ** Pulse.Lib.Core.pure (FStar.Seq.Base.equal s (FStar.Seq.Base.create (FStar.SizeT.v l) 0uy)))
Prims.Tot
[ "total" ]
[]
[ "Pulse.Lib.Array.zeroize'" ]
[]
false
false
false
false
false
let zeroize =
zeroize'
false
Hacl.HPKE.Curve64_CP128_SHA256.fsti
Hacl.HPKE.Curve64_CP128_SHA256.cs
val cs:S.ciphersuite
val cs:S.ciphersuite
let cs:S.ciphersuite = (DH.DH_Curve25519, Hash.SHA2_256, S.Seal AEAD.CHACHA20_POLY1305, Hash.SHA2_256)
{ "file_name": "code/hpke/Hacl.HPKE.Curve64_CP128_SHA256.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 102, "end_line": 10, "start_col": 0, "start_line": 10 }
module Hacl.HPKE.Curve64_CP128_SHA256 open Hacl.Impl.HPKE module S = Spec.Agile.HPKE module DH = Spec.Agile.DH module AEAD = Spec.Agile.AEAD module Hash = Spec.Agile.Hash
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Spec.Agile.HPKE.fsti.checked", "Spec.Agile.Hash.fsti.checked", "Spec.Agile.DH.fst.checked", "Spec.Agile.AEAD.fsti.checked", "prims.fst.checked", "Hacl.Impl.HPKE.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Hacl.HPKE.Curve64_CP128_SHA256.fsti" }
[ { "abbrev": true, "full_module": "Spec.Agile.Hash", "short_module": "Hash" }, { "abbrev": true, "full_module": "Spec.Agile.AEAD", "short_module": "AEAD" }, { "abbrev": true, "full_module": "Spec.Agile.DH", "short_module": "DH" }, { "abbrev": true, "full_module": "Spec.Agile.HPKE", "short_module": "S" }, { "abbrev": false, "full_module": "Hacl.Impl.HPKE", "short_module": null }, { "abbrev": false, "full_module": "Hacl.HPKE", "short_module": null }, { "abbrev": false, "full_module": "Hacl.HPKE", "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 } ]
{ "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": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Spec.Agile.HPKE.ciphersuite
Prims.Tot
[ "total" ]
[]
[ "FStar.Pervasives.Native.Mktuple4", "Spec.Agile.DH.algorithm", "Spec.Agile.HPKE.hash_algorithm", "Spec.Agile.HPKE.aead", "Spec.Hash.Definitions.hash_alg", "Spec.Agile.DH.DH_Curve25519", "Spec.Hash.Definitions.SHA2_256", "Spec.Agile.HPKE.Seal", "Spec.Agile.AEAD.CHACHA20_POLY1305" ]
[]
false
false
false
true
false
let cs:S.ciphersuite =
(DH.DH_Curve25519, Hash.SHA2_256, S.Seal AEAD.CHACHA20_POLY1305, Hash.SHA2_256)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Sub64
val va_code_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 291, "start_col": 0, "start_line": 290 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Sub64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Sub64
val va_codegen_success_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Sub64 dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 295, "start_col": 0, "start_line": 294 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Cmovc64
val va_wpProof_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cmovc64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cmovc64 dst src) ([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cmovc64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cmovc64 dst src) ([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 69, "start_col": 0, "start_line": 63 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Cmovc64", "Vale.X64.InsBasic.va_code_Cmovc64" ]
[]
false
false
false
false
false
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Sub64Wrap
val va_code_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 321, "start_col": 0, "start_line": 320 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Sub64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Sub64Wrap
val va_codegen_success_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Sub64Wrap dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 325, "start_col": 0, "start_line": 324 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Add64
val va_wpProof_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Add64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Add64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 99, "start_col": 0, "start_line": 92 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Add64", "Vale.X64.InsBasic.va_code_Add64" ]
[]
false
false
false
false
false
let va_wpProof_Add64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Sbb64
val va_code_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 351, "start_col": 0, "start_line": 350 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Sbb64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Mov64
val va_wpProof_Mov64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Mov64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mov64 dst src) ([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Mov64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Mov64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mov64 dst src) ([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 40, "start_col": 0, "start_line": 34 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Mov64", "Vale.X64.InsBasic.va_code_Mov64" ]
[]
false
false
false
false
false
let va_wpProof_Mov64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Sbb64
val va_codegen_success_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Sbb64 dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 355, "start_col": 0, "start_line": 354 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Mul64Wrap
val va_codegen_success_Mul64Wrap : src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Mul64Wrap : src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Mul64Wrap src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 394, "start_col": 0, "start_line": 393 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Mul64Wrap
val va_code_Mul64Wrap : src:va_operand_opr64 -> Tot va_code
val va_code_Mul64Wrap : src:va_operand_opr64 -> Tot va_code
let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 41, "end_line": 390, "start_col": 0, "start_line": 389 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRdx", "Vale.X64.Instruction_s.inOut", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.op64", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Mul64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_AddLea64
val va_wpProof_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AddLea64 dst src1 src2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AddLea64 dst src1 src2) ([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AddLea64 dst src1 src2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AddLea64 dst src1 src2) ([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 158, "start_col": 0, "start_line": 152 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src1: Vale.X64.Decls.va_operand_opr64 -> src2: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_AddLea64", "Vale.X64.InsBasic.va_code_AddLea64" ]
[]
false
false
false
false
false
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let va_sM, va_f0 = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_IMul64
val va_codegen_success_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_IMul64 dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 460, "start_col": 0, "start_line": 459 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Add64Wrap
val va_wpProof_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Add64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Add64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 129, "start_col": 0, "start_line": 122 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Add64Wrap", "Vale.X64.InsBasic.va_code_Add64Wrap" ]
[]
false
false
false
false
false
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Mulx64
val va_code_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 56, "end_line": 421, "start_col": 0, "start_line": 420 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst_hi: Vale.X64.Decls.va_operand_dst_opr64 -> dst_lo: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRdx", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Mulx64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Xor64
val va_code_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 75, "end_line": 488, "start_col": 0, "start_line": 487 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr_annotate", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.opFlagsOf", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Xor64", "Vale.X64.Machine_Semantics_s.AnnotateXor64", "Vale.X64.Instruction_s.InstrTypeRecord", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Mulx64
val va_codegen_success_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 425, "start_col": 0, "start_line": 424 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst_hi: Vale.X64.Decls.va_operand_dst_opr64 -> dst_lo: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_IMul64
val va_code_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 456, "start_col": 0, "start_line": 455 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_IMul64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Xor64
val va_codegen_success_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Xor64 dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 492, "start_col": 0, "start_line": 491 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Adc64
val va_wpProof_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adc64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adc64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 188, "start_col": 0, "start_line": 181 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Adc64", "Vale.X64.InsBasic.va_code_Adc64" ]
[]
false
false
false
false
false
let va_wpProof_Adc64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_And64
val va_code_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
val va_code_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 519, "start_col": 0, "start_line": 518 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_And64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Adc64Wrap
val va_wpProof_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adc64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adc64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 218, "start_col": 0, "start_line": 211 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Adc64Wrap", "Vale.X64.InsBasic.va_code_Adc64Wrap" ]
[]
false
false
false
false
false
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_And64
val va_codegen_success_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
val va_codegen_success_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_And64 dst src = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 523, "start_col": 0, "start_line": 522 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_And64 dst src =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Shl64
val va_code_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_code
val va_code_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_code
let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 549, "start_col": 0, "start_line": 548 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_shift_amt64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Shl64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Mov64
val va_lemma_Mov64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Mov64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
val va_lemma_Mov64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Mov64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 30, "start_col": 0, "start_line": 24 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr_annotate", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Mov64", "Vale.X64.Machine_Semantics_s.AnnotateMov64", "Vale.X64.Instruction_s.InstrTypeRecord", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Mov64" ]
[]
false
false
false
false
false
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Shl64
val va_codegen_success_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_pbool
val va_codegen_success_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_pbool
let va_codegen_success_Shl64 dst amt = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 553, "start_col": 0, "start_line": 552 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Shr64
val va_codegen_success_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_pbool
val va_codegen_success_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_pbool
let va_codegen_success_Shr64 dst amt = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 583, "start_col": 0, "start_line": 582 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Shr64
val va_code_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_code
val va_code_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot va_code
let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 45, "end_line": 579, "start_col": 0, "start_line": 578 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_shift_amt64", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Shr64", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Adox64Wrap
val va_wpProof_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adox64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adox64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adox64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adox64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 284, "start_col": 0, "start_line": 277 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Adox64Wrap", "Vale.X64.InsBasic.va_code_Adox64Wrap" ]
[]
false
false
false
false
false
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_AES
val va_code_Cpuid_AES : va_dummy:unit -> Tot va_code
val va_code_Cpuid_AES : va_dummy:unit -> Tot va_code
let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 609, "start_col": 0, "start_line": 608 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Adcx64Wrap
val va_wpProof_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adcx64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adcx64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Adcx64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adcx64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 253, "start_col": 0, "start_line": 246 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "boxwrap", "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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Adcx64Wrap", "Vale.X64.InsBasic.va_code_Adcx64Wrap" ]
[]
false
false
false
false
false
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Add64
val va_lemma_Add64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Add64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64 va_s0 dst < pow2_64)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_Add64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Add64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64 va_s0 dst < pow2_64)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 88, "start_col": 0, "start_line": 83 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Add64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Add64" ]
[]
false
false
false
false
false
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Sub64
val va_wpProof_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Sub64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Sub64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 314, "start_col": 0, "start_line": 307 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Sub64", "Vale.X64.InsBasic.va_code_Sub64" ]
[]
false
false
false
false
false
let va_wpProof_Sub64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_AddLea64
val va_lemma_AddLea64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AddLea64 dst src1 src2) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src1 va_s0 /\ va_is_src_opr64 src2 va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.max_one_mem src1 src2 /\ va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 < pow2_64)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
val va_lemma_AddLea64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AddLea64 dst src1 src2) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src1 va_s0 /\ va_is_src_opr64 src2 va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.max_one_mem src1 src2 /\ va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 < pow2_64)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 148, "start_col": 0, "start_line": 143 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src1: Vale.X64.Decls.va_operand_opr64 -> src2: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_AddLea64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_AddLea64" ]
[]
false
false
false
false
false
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_AES
val va_codegen_success_Cpuid_AES : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_AES : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_AES () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 613, "start_col": 0, "start_line": 612 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Sha
val va_code_Cpuid_Sha : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Sha : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 641, "start_col": 0, "start_line": 640 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Sha
val va_codegen_success_Cpuid_Sha : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Sha : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Sha () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 645, "start_col": 0, "start_line": 644 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Mul64Wrap
val va_wpProof_Mul64Wrap : src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Mul64Wrap src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mul64Wrap src) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Mul64Wrap : src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Mul64Wrap src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mul64Wrap src) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 414, "start_col": 0, "start_line": 407 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_flags", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Mul64Wrap", "Vale.X64.InsBasic.va_code_Mul64Wrap" ]
[]
false
false
false
false
false
let va_wpProof_Mul64Wrap src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Adx_Bmi2
val va_code_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 673, "start_col": 0, "start_line": 672 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Sub64Wrap
val va_wpProof_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Sub64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Sub64Wrap dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64Wrap dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 344, "start_col": 0, "start_line": 337 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Sub64Wrap", "Vale.X64.InsBasic.va_code_Sub64Wrap" ]
[]
false
false
false
false
false
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Sbb64
val va_wpProof_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Sbb64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sbb64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Sbb64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sbb64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 374, "start_col": 0, "start_line": 367 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Sbb64", "Vale.X64.InsBasic.va_code_Sbb64" ]
[]
false
false
false
false
false
let va_wpProof_Sbb64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Adc64
val va_lemma_Adc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Adc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64 va_s0 dst + 1 < pow2_64 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_Adc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Adc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64 va_s0 dst + 1 < pow2_64 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 177, "start_col": 0, "start_line": 172 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_AddCarry64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Adc64" ]
[]
false
false
false
false
false
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx
val va_codegen_success_Cpuid_Avx : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Avx : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Avx () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 709, "start_col": 0, "start_line": 708 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx2
val va_codegen_success_Cpuid_Avx2 : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Avx2 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 741, "start_col": 0, "start_line": 740 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
false
Hacl.Streaming.Functor.fst
Hacl.Streaming.Functor.digest
val digest: #index:Type0 -> c:block index -> i:index -> t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key (G.reveal i) c.km c.key } -> digest_st c i t t'
val digest: #index:Type0 -> c:block index -> i:index -> t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key (G.reveal i) c.km c.key } -> digest_st c i t t'
let digest #index c i t t' state output l = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in [@inline_let] let _ = c.update_multi_associative i in [@inline_let] let _ = allow_inversion key_management in let open LowStar.BufferOps in let h0 = ST.get () in let State block_state buf_ total_len seen k' = !*state in push_frame (); let h1 = ST.get () in c.state.frame_invariant #i B.loc_none block_state h0 h1; stateful_frame_preserves_freeable #index #c.state #i B.loc_none block_state h0 h1; optional_frame #_ #i #c.km #c.key B.loc_none k' h0 h1; let r = rest c i total_len in let buf_ = B.sub buf_ 0ul r in let tmp_block_state = c.state.alloca i in let h2 = ST.get () in assert (B.(loc_disjoint (c.state.footprint #i h2 tmp_block_state) (c.state.footprint #i h1 block_state))); B.modifies_only_not_unused_in B.loc_none h1 h2; c.state.frame_invariant #i B.loc_none block_state h1 h2; stateful_frame_preserves_freeable #index #c.state #i B.loc_none block_state h1 h2; optional_frame #_ #i #c.km #c.key B.loc_none k' h1 h2; c.state.copy (G.hide i) block_state tmp_block_state; let h3 = ST.get () in c.state.frame_invariant #i (c.state.footprint h2 tmp_block_state) block_state h2 h3; stateful_frame_preserves_freeable #index #c.state #i (c.state.footprint h2 tmp_block_state) block_state h2 h3; optional_frame #_ #i #c.km #c.key (c.state.footprint h2 tmp_block_state) k' h2 h3; // Process as many blocks as possible (but leave at least one block for update_last) let prev_len = U64.(total_len `sub` FStar.Int.Cast.uint32_to_uint64 r) in // The data length to give to update_last [@inline_let] let r_last = rest_finish c i r in // The data length to process with update_multi before calling update_last [@inline_let] let r_multi = U32.(r -^ r_last) in // Split the buffer according to the computed lengths let buf_last = B.sub buf_ r_multi (Ghost.hide r_last) in let buf_multi = B.sub buf_ 0ul r_multi in [@inline_let] let state_is_block = c.block_len i = c.blocks_state_len i in assert(state_is_block ==> U32.v r_multi = 0); assert(state_is_block ==> r_last = r); // This will get simplified and will allow some simplifications in the generated code. // In particular, it should allow to simplify a bit update_multi [@inline_let] let r_multi = if state_is_block then 0ul else r_multi in [@inline_let] let r_last = if state_is_block then r else r_last in c.update_multi (G.hide i) tmp_block_state prev_len buf_multi r_multi; let h4 = get () in optional_frame #_ #i #c.km #c.key (c.state.footprint #i h3 tmp_block_state) k' h3 h4; // Functional correctness digest_process_begin_functional_correctness #index c i t t' state output l h0 h4 tmp_block_state; split_at_last_finish c i (all_seen c i h0 state); // Process the remaining data assert(UInt32.v r_last <= UInt32.v (Block?.block_len c (Ghost.reveal (Ghost.hide i)))); let prev_len_last = U64.(total_len `sub` FStar.Int.Cast.uint32_to_uint64 r_last) in begin // Proving: prev_len_last % block_len = 0 assert(U64.v prev_len_last = U64.v prev_len + U32.v r_multi); Math.Lemmas.modulo_distributivity (U64.v prev_len) (U32.v r_multi) (U32.v (c.block_len i)); Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert(U64.v prev_len_last % U32.v (c.block_len i) = 0) end; c.update_last (G.hide i) tmp_block_state prev_len_last buf_last r_last; let h5 = ST.get () in c.state.frame_invariant #i (c.state.footprint h3 tmp_block_state) block_state h3 h5; stateful_frame_preserves_freeable #index #c.state #i (c.state.footprint h3 tmp_block_state) block_state h3 h5; optional_frame #_ #i #c.km #c.key (c.state.footprint h3 tmp_block_state) k' h3 h5; c.finish (G.hide i) k' tmp_block_state output l; let h6 = ST.get () in begin let r = r_last in let all_seen = all_seen c i h0 state in let blocks_state_length = U32.v (c.blocks_state_len i) in let block_length = U32.v (c.block_len i) in let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem block_length (S.length all_seen)) in let blocks, rest_ = Lib.UpdateMulti.split_at_last_lazy block_length all_seen in let k = optional_reveal #_ #i #c.km #c.key h0 k' in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert(0 % U32.v (c.block_len i) = 0); assert(B.as_seq h3 buf_last == rest_); calc (S.equal) { B.as_seq h6 output; (S.equal) { } c.finish_s i k (c.state.v i h5 tmp_block_state) l; (S.equal) { } c.finish_s i k ( c.update_last_s i (c.state.v i h4 tmp_block_state) (n * block_length) (B.as_seq h4 buf_last)) l; (S.equal) { } c.finish_s i k ( c.update_last_s i (c.state.v i h4 tmp_block_state) (n * block_length) rest_) l; (S.equal) { } c.finish_s i k ( c.update_last_s i (c.update_multi_s i (c.init_s i k) 0 (S.slice all_seen 0 (n * block_length))) (n * block_length) rest_) l; (S.equal) { c.spec_is_incremental i k seen l } c.spec_s i k seen l; } end; c.state.frame_invariant #i B.(loc_buffer output `loc_union` c.state.footprint h5 tmp_block_state) block_state h5 h6; stateful_frame_preserves_freeable #index #c.state #i B.(loc_buffer output `loc_union` c.state.footprint h5 tmp_block_state) block_state h5 h6; optional_frame #_ #i #c.km #c.key B.(loc_buffer output `loc_union` c.state.footprint h5 tmp_block_state) k' h5 h6; pop_frame (); let h7 = ST.get () in c.state.frame_invariant #i B.(loc_region_only false (HS.get_tip h6)) block_state h6 h7; stateful_frame_preserves_freeable #index #c.state #i B.(loc_region_only false (HS.get_tip h6)) block_state h6 h7; optional_frame #_ #i #c.km #c.key B.(loc_region_only false (HS.get_tip h6)) k' h6 h7; assert (seen_h c i h7 state `S.equal` (G.reveal seen)); // JP: this is not the right way to prove do this proof. Need to use // modifies_fresh_frame_popped instead, see e.g. // https://github.com/project-everest/everquic-crypto/blob/d812be94e9b1a77261f001c9accb2040b80b7c39/src/QUIC.Impl.fst#L1111 // for an example let mloc = B.loc_union (B.loc_buffer output) (footprint c i h0 state) in B.modifies_remove_fresh_frame h0 h1 h7 mloc; B.popped_modifies h6 h7; assert (B.(modifies mloc h0 h7))
{ "file_name": "code/streaming/Hacl.Streaming.Functor.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 34, "end_line": 1800, "start_col": 0, "start_line": 1654 }
module Hacl.Streaming.Functor /// Provided an instance of the type class, this creates a streaming API on top. /// This means that every function in this module takes two extra arguments /// compared to the previous streaming module specialized for hashes: the type /// of the index, and a type class for that index. Then, as usual, a given value /// for the index as a parameter. #set-options "--max_fuel 0 --max_ifuel 0 \ --using_facts_from '*,-LowStar.Monotonic.Buffer.unused_in_not_unused_in_disjoint_2' --z3rlimit 50" module ST = FStar.HyperStack.ST module HS = FStar.HyperStack module B = LowStar.Buffer module G = FStar.Ghost module S = FStar.Seq module U32 = FStar.UInt32 module U64 = FStar.UInt64 open Hacl.Streaming.Interface open FStar.HyperStack.ST open LowStar.BufferOps open FStar.Mul open Hacl.Streaming.Spec /// State machinery /// =============== /// Little bit of trickery here to make sure state_s is parameterized over /// something at Type0, not Type0 -> Type0 -- otherwise it wouldn't monomorphize /// in KaRaMeL. noeq type state_s #index (c: block index) (i: index) (t: Type0 { t == c.state.s i }) (t': Type0 { t' == optional_key i c.km c.key }) = | State: block_state: t -> buf: B.buffer Lib.IntTypes.uint8 { B.len buf = c.blocks_state_len i } -> total_len: UInt64.t -> seen: G.erased (S.seq uint8) -> // Stupid name conflict on overloaded projectors leads to inscrutable // interleaving errors. Need a field name that does not conflict with the // one in Hacl.Streaming.Interface. Sigh!! p_key: t' -> state_s #index c i t t' /// Defining a series of helpers to deal with the indexed type of the key. This /// makes proofs easier. let optional_freeable #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> True | Runtime -> key.freeable #i h k let optional_invariant #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> True | Runtime -> key.invariant #i h k let optional_footprint #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> B.loc_none | Runtime -> key.footprint #i h k let optional_reveal #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> G.reveal k | Runtime -> key.v i h k let optional_hide #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: key.s i): optional_key i km key = allow_inversion key_management; match km with | Erased -> G.hide (key.v i h k) | Runtime -> k /// This lemma is used to convert the Hacl.Streaming.Interface.stateful.frame_freeable /// lemma, written with freeable in its precondition, into a lemma of the form: /// [> freeable h0 s => freeable h1 s val stateful_frame_preserves_freeable: #index:Type0 -> #sc:stateful index -> #i:index -> l:B.loc -> s:sc.s i -> h0:HS.mem -> h1:HS.mem -> Lemma (requires ( sc.invariant h0 s /\ B.loc_disjoint l (sc.footprint h0 s) /\ B.modifies l h0 h1)) (ensures ( sc.freeable h0 s ==> sc.freeable h1 s)) let stateful_frame_preserves_freeable #index #sc #i l s h0 h1 = let lem h0 h1 : Lemma (requires ( sc.invariant h0 s /\ B.loc_disjoint l (sc.footprint h0 s) /\ B.modifies l h0 h1 /\ sc.freeable h0 s)) (ensures ( sc.freeable h1 s)) [SMTPat (sc.freeable h0 s); SMTPat (sc.freeable h1 s)] = sc.frame_freeable l s h0 h1 in () let optional_frame #index (#i: index) (#km: key_management) (#key: stateful index) (l: B.loc) (s: optional_key i km key) (h0 h1: HS.mem): Lemma (requires ( optional_invariant h0 s /\ B.loc_disjoint l (optional_footprint h0 s) /\ B.modifies l h0 h1)) (ensures ( optional_invariant h1 s /\ optional_reveal h0 s == optional_reveal h1 s /\ optional_footprint h1 s == optional_footprint h0 s /\ (optional_freeable h0 s ==> optional_freeable h1 s))) = allow_inversion key_management; match km with | Erased -> () | Runtime -> key.frame_invariant #i l s h0 h1; stateful_frame_preserves_freeable #index #key #i l s h0 h1 let footprint_s #index (c: block index) (i: index) (h: HS.mem) s = let State block_state buf_ _ _ p_key = s in B.(loc_addr_of_buffer buf_ `loc_union` c.state.footprint h block_state `loc_union` optional_footprint h p_key) /// Invariants /// ========== #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let invariant_s #index (c: block index) (i: index) h s = let State block_state buf_ total_len seen key = s in let seen = G.reveal seen in let key_v = optional_reveal h key in let all_seen = S.append (c.init_input_s i key_v) seen in let blocks, rest = split_at_last c i all_seen in (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.block_len c i)); (**) assert(0 % U32.v (Block?.block_len c i) = 0); (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.blocks_state_len c i)); (**) assert(0 % U32.v (Block?.blocks_state_len c i) = 0); // Liveness and disjointness (administrative) B.live h buf_ /\ c.state.invariant #i h block_state /\ optional_invariant h key /\ B.(loc_disjoint (loc_buffer buf_) (c.state.footprint h block_state)) /\ B.(loc_disjoint (loc_buffer buf_) (optional_footprint h key)) /\ B.(loc_disjoint (optional_footprint h key) (c.state.footprint h block_state)) /\ // Formerly, the "hashes" predicate S.length blocks + S.length rest = U64.v total_len /\ U32.v (c.init_input_len i) + S.length seen = U64.v total_len /\ U64.v total_len <= U64.v (c.max_input_len i) /\ // Note the double equals here, we now no longer know that this is a sequence. c.state.v i h block_state == c.update_multi_s i (c.init_s i key_v) 0 blocks /\ S.equal (S.slice (B.as_seq h buf_) 0 (Seq.length rest)) rest #pop-options inline_for_extraction noextract let freeable_s (#index: Type0) (c: block index) (i: index) (h: HS.mem) (s: state_s' c i): Type0 = let State block_state buf_ total_len seen key = s in B.freeable buf_ /\ c.state.freeable h block_state /\ optional_freeable h key let freeable (#index : Type0) (c: block index) (i: index) (h: HS.mem) (s: state' c i) = freeable_s c i h (B.get h s 0) /\ B.freeable s #push-options "--max_ifuel 1" let invariant_loc_in_footprint #index c i s m = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in () #pop-options let seen #index c i h s = G.reveal (State?.seen (B.deref h s)) let seen_bounded #index c i h s = () let reveal_key #index c i h s = optional_reveal h (State?.p_key (B.deref h s)) let init_input (#index:Type0) (c:block index) (i:index) (h:HS.mem) (s:state' c i) : GTot bytes = c.init_input_s i (reveal_key c i h s) let all_seen (#index:Type0) (c:block index) (i:index) (h:HS.mem) (s:state' c i) : GTot bytes = S.append (init_input c i h s) (seen c i h s) let frame_invariant #index c i l s h0 h1 = let state_t = B.deref h0 s in let State block_state _ _ _ p_key = state_t in c.state.frame_invariant #i l block_state h0 h1; stateful_frame_preserves_freeable #index #c.state #i l block_state h0 h1; allow_inversion key_management; match c.km with | Erased -> () | Runtime -> stateful_frame_preserves_freeable #index #c.key #i l p_key h0 h1; c.key.frame_invariant #i l p_key h0 h1 let frame_seen #_ _ _ _ _ _ _ = () /// Stateful API /// ============ let index_of_state #index c i t t' s = let open LowStar.BufferOps in let State block_state _ _ _ _ = !*s in c.index_of_state i block_state let seen_length #index c i t t' s = let open LowStar.BufferOps in let State _ _ total_len _ _ = !*s in total_len (* TODO: malloc and alloca have big portions of proofs in common, so it may * be possible to factorize them, but it is not clear how *) #restart-solver #push-options "--z3rlimit 500" let malloc #index c i t t' key r = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; (**) let h0 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h0; let buf = B.malloc r (Lib.IntTypes.u8 0) (c.blocks_state_len i) in (**) let h1 = ST.get () in (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h1); (**) B.loc_unused_in_not_unused_in_disjoint h1; (**) B.(modifies_only_not_unused_in loc_none h0 h1); (**) c.key.frame_invariant B.loc_none key h0 h1; let block_state = c.state.create_in i r in (**) let h2 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h2 block_state) h0 h2); (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) c.key.frame_invariant B.loc_none key h1 h2; let k': optional_key i c.km c.key = match c.km with | Runtime -> let k' = c.key.create_in i r in (**) let h3 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h3; (**) B.(modifies_only_not_unused_in loc_none h2 h3); (**) c.key.frame_invariant B.loc_none key h2 h3; (**) c.state.frame_invariant B.loc_none block_state h2 h3; (**) c.state.frame_freeable B.loc_none block_state h2 h3; (**) assert (B.fresh_loc (c.key.footprint #i h3 k') h0 h3); (**) assert (c.key.invariant #i h3 k'); (**) assert (c.key.invariant #i h3 key); (**) assert B.(loc_disjoint (c.key.footprint #i h3 key) (c.key.footprint #i h3 k')); c.key.copy i key k'; (**) let h4 = ST.get () in (**) assert (B.fresh_loc (c.key.footprint #i h4 k') h0 h4); (**) B.loc_unused_in_not_unused_in_disjoint h4; (**) B.(modifies_only_not_unused_in loc_none h2 h4); (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant (c.key.footprint #i h3 k') key h3 h4; (**) c.state.frame_invariant (c.key.footprint #i h3 k') block_state h3 h4; (**) c.state.frame_freeable (c.key.footprint #i h3 k') block_state h3 h4; k' | Erased -> G.hide (c.key.v i h0 key) in (**) let h5 = ST.get () in (**) assert (B.fresh_loc (optional_footprint h5 k') h0 h5); (**) assert (B.fresh_loc (c.state.footprint #i h5 block_state) h0 h5); [@inline_let] let total_len = Int.Cast.uint32_to_uint64 (c.init_input_len i) in let s = State block_state buf total_len (G.hide S.empty) k' in (**) assert (B.fresh_loc (footprint_s c i h5 s) h0 h5); (**) B.loc_unused_in_not_unused_in_disjoint h5; let p = B.malloc r s 1ul in (**) let h6 = ST.get () in (**) B.(modifies_only_not_unused_in loc_none h5 h6); (**) B.(modifies_only_not_unused_in loc_none h0 h6); (**) c.key.frame_invariant B.loc_none key h5 h6; (**) c.state.frame_invariant B.loc_none block_state h5 h6; (**) optional_frame B.loc_none k' h5 h6; (**) assert (B.fresh_loc (B.loc_addr_of_buffer p) h0 h6); (**) assert (B.fresh_loc (footprint_s c i h6 s) h0 h6); (**) c.state.frame_freeable B.loc_none block_state h5 h6; (**) assert (optional_reveal h5 k' == optional_reveal h6 k'); c.init (G.hide i) key buf block_state; (**) let h7 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h7 block_state) h0 h7); (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h7); (**) optional_frame (B.loc_union (c.state.footprint #i h7 block_state) (B.loc_buffer buf)) k' h6 h7; (**) c.update_multi_zero i (c.state.v i h7 block_state) 0; (**) B.modifies_only_not_unused_in B.loc_none h0 h7; (**) assert (c.state.v i h7 block_state == c.init_s i (optional_reveal h6 k')); (**) let h8 = ST.get () in (**) assert (U64.v total_len <= U64.v (c.max_input_len i)); (**) begin (**) let s = B.get h8 p 0 in (**) let key_v = reveal_key c i h8 p in (**) let init_input = c.init_input_s i key_v in (**) split_at_last_init c i init_input; (**) assert(invariant_s c i h8 s) (**) end; (**) assert (invariant c i h8 p); (**) assert (seen c i h8 p == S.empty); (**) assert B.(modifies loc_none h0 h8); (**) assert (B.fresh_loc (footprint c i h8 p) h0 h8); (**) assert B.(loc_includes (loc_region_only true r) (footprint c i h8 p)); (**) assert (ST.equal_stack_domains h1 h8); (**) assert (ST.equal_stack_domains h0 h1); p #pop-options #push-options "--z3rlimit 100" let copy #index c i t t' state r = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; // All source state is suffixed by 0. let State block_state0 buf0 total_len0 seen0 k0 = !*state in let i = c.index_of_state i block_state0 in (**) let h0 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h0; let buf = B.malloc r (Lib.IntTypes.u8 0) (c.blocks_state_len i) in B.blit buf0 0ul buf 0ul (c.blocks_state_len i); (**) let h1 = ST.get () in (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h1); (**) B.loc_unused_in_not_unused_in_disjoint h1; (**) B.(modifies_only_not_unused_in loc_none h0 h1); (**) if c.km = Runtime then (**) c.key.frame_invariant #i B.loc_none k0 h0 h1; (**) c.state.frame_invariant #i B.loc_none block_state0 h0 h1; (**) assert (invariant c i h1 state); let block_state = c.state.create_in i r in (**) let h2 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h2 block_state) h0 h2); (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) if c.km = Runtime then (**) c.key.frame_invariant #i B.loc_none k0 h1 h2; (**) c.state.frame_invariant #i B.loc_none block_state0 h0 h1; (**) assert (invariant c i h2 state); c.state.copy (G.hide i) block_state0 block_state; (**) let h2 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) if c.km = Runtime then (**) c.key.frame_invariant #i (c.state.footprint #i h2 block_state) k0 h1 h2; let k': optional_key i c.km c.key = match c.km with | Runtime -> let k' = c.key.create_in i r in (**) let h3 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h3; (**) B.(modifies_only_not_unused_in loc_none h2 h3); (**) c.key.frame_invariant #i B.loc_none k0 h2 h3; (**) c.state.frame_invariant #i B.loc_none block_state h2 h3; (**) c.state.frame_freeable #i B.loc_none block_state h2 h3; (**) assert (B.fresh_loc (c.key.footprint #i h3 k') h0 h3); (**) assert (c.key.invariant #i h3 k'); (**) assert (c.key.invariant #i h3 k0); (**) assert B.(loc_disjoint (c.key.footprint #i h3 k0) (c.key.footprint #i h3 k')); c.key.copy i k0 k'; (**) let h4 = ST.get () in (**) assert (B.fresh_loc (c.key.footprint #i h4 k') h0 h4); (**) B.loc_unused_in_not_unused_in_disjoint h4; (**) B.(modifies_only_not_unused_in loc_none h2 h4); (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant #i (c.key.footprint #i h3 k') k0 h3 h4; (**) c.state.frame_invariant #i (c.key.footprint #i h3 k') block_state h3 h4; (**) c.state.frame_freeable #i (c.key.footprint #i h3 k') block_state h3 h4; k' | Erased -> k0 in (**) let h5 = ST.get () in (**) assert (B.fresh_loc (optional_footprint h5 k') h0 h5); (**) assert (B.fresh_loc (c.state.footprint #i h5 block_state) h0 h5); let s = State block_state buf total_len0 seen0 k' in (**) assert (B.fresh_loc (footprint_s c i h5 s) h0 h5); (**) B.loc_unused_in_not_unused_in_disjoint h5; let p = B.malloc r s 1ul in (**) let h6 = ST.get () in (**) B.(modifies_only_not_unused_in loc_none h5 h6); (**) B.(modifies_only_not_unused_in loc_none h0 h6); (**) if c.km = Runtime then (**) c.key.frame_invariant #i B.loc_none k0 h5 h6; (**) c.state.frame_invariant #i B.loc_none block_state h5 h6; (**) optional_frame B.loc_none k' h5 h6; (**) assert (B.fresh_loc (B.loc_addr_of_buffer p) h0 h6); (**) assert (B.fresh_loc (footprint_s c i h6 s) h0 h6); (**) c.state.frame_freeable B.loc_none block_state h5 h6; (**) assert (optional_reveal h5 k' == optional_reveal h6 k'); p #pop-options #push-options "--z3rlimit 200" let alloca #index c i t t' k = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; (**) let h0 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h0; let buf = B.alloca (Lib.IntTypes.u8 0) (c.blocks_state_len i) in (**) let h1 = ST.get () in (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h1); (**) B.loc_unused_in_not_unused_in_disjoint h1; (**) B.(modifies_only_not_unused_in loc_none h0 h1); (**) c.key.frame_invariant B.loc_none k h0 h1; let block_state = c.state.alloca i in (**) let h2 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h2 block_state) h0 h2); (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) c.key.frame_invariant B.loc_none k h1 h2; let k': optional_key i c.km c.key = match c.km with | Runtime -> let k' = c.key.alloca i in (**) let h3 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h3; (**) B.(modifies_only_not_unused_in loc_none h2 h3); (**) c.key.frame_invariant B.loc_none k h2 h3; (**) c.state.frame_invariant B.loc_none block_state h2 h3; (**) assert (B.fresh_loc (c.key.footprint #i h3 k') h0 h3); (**) assert (c.key.invariant #i h3 k'); (**) assert (c.key.invariant #i h3 k); (**) assert B.(loc_disjoint (c.key.footprint #i h3 k) (c.key.footprint #i h3 k')); c.key.copy i k k'; (**) let h4 = ST.get () in (**) assert (B.fresh_loc (c.key.footprint #i h4 k') h0 h4); (**) B.loc_unused_in_not_unused_in_disjoint h4; (**) B.(modifies_only_not_unused_in loc_none h2 h4); (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant (c.key.footprint #i h3 k') k h3 h4; (**) c.state.frame_invariant (c.key.footprint #i h3 k') block_state h3 h4; k' | Erased -> G.hide (c.key.v i h0 k) in (**) let h5 = ST.get () in (**) assert (B.fresh_loc (optional_footprint h5 k') h0 h5); (**) assert (B.fresh_loc (c.state.footprint #i h5 block_state) h0 h5); [@inline_let] let total_len = Int.Cast.uint32_to_uint64 (c.init_input_len i) in let s = State block_state buf total_len (G.hide S.empty) k' in (**) assert (B.fresh_loc (footprint_s c i h5 s) h0 h5); (**) B.loc_unused_in_not_unused_in_disjoint h5; let p = B.alloca s 1ul in (**) let h6 = ST.get () in (**) B.(modifies_only_not_unused_in loc_none h5 h6); (**) B.(modifies_only_not_unused_in loc_none h0 h6); (**) c.key.frame_invariant B.loc_none k h5 h6; (**) c.state.frame_invariant B.loc_none block_state h5 h6; (**) optional_frame B.loc_none k' h5 h6; (**) assert (B.fresh_loc (B.loc_addr_of_buffer p) h0 h6); (**) assert (B.fresh_loc (footprint_s c i h6 s) h0 h6); (**) assert (optional_reveal h5 k' == optional_reveal h6 k'); c.init (G.hide i) k buf block_state; (**) let h7 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h7 block_state) h0 h7); (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h7); (**) optional_frame (B.loc_union (c.state.footprint #i h7 block_state) (B.loc_buffer buf)) k' h6 h7; (**) c.update_multi_zero i (c.state.v i h7 block_state) 0; (**) B.modifies_only_not_unused_in B.loc_none h0 h7; (**) assert (c.state.v i h7 block_state == c.init_s i (optional_reveal h6 k')); (**) let h8 = ST.get () in (**) assert (U64.v total_len <= U64.v (c.max_input_len i)); (**) begin (**) let key_v = reveal_key c i h8 p in (**) let init_input = c.init_input_s i key_v in (**) split_at_last_init c i init_input; (**) assert(invariant_s c i h8 s) (**) end; (**) assert (invariant c i h8 p); (**) assert (seen c i h8 p == S.empty); (**) assert B.(modifies loc_none h0 h8); (**) assert (B.fresh_loc (footprint c i h8 p) h0 h8); (**) assert B.(loc_includes (loc_region_only true (HS.get_tip h8)) (footprint c i h8 p)); (**) assert(ST.same_refs_in_non_tip_regions h0 h8); p #pop-options #push-options "--z3cliopt smt.arith.nl=false" let reset #index c i t t' state key = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; let open LowStar.BufferOps in (**) let h1 = ST.get () in let State block_state buf _ _ k' = !*state in let i = c.index_of_state i block_state in LowStar.Ignore.ignore i; // This is only used in types and proofs [@inline_let] let block_state: c.state.s i = block_state in c.init (G.hide i) key buf block_state; (**) let h2 = ST.get () in (**) optional_frame #_ #i #c.km #c.key (B.loc_union (c.state.footprint #i h1 block_state) (B.loc_buffer buf)) k' h1 h2; (**) c.key.frame_invariant (B.loc_union (c.state.footprint #i h1 block_state) (B.loc_buffer buf)) key h1 h2; (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.block_len c i)); (**) assert(0 % UInt32.v (Block?.block_len c i) = 0); (**) assert (reveal_key c i h1 state == reveal_key c i h2 state); (**) c.update_multi_zero i (c.state.v i h2 block_state) 0; let k': optional_key i c.km c.key = match c.km with | Runtime -> c.key.copy i key k'; (**) let h4 = ST.get () in (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant (c.key.footprint #i h2 k') key h2 h4; (**) c.state.frame_invariant (c.key.footprint #i h2 k') block_state h2 h4; (**) stateful_frame_preserves_freeable (c.key.footprint #i h2 k') block_state h2 h4; k' | Erased -> G.hide (c.key.v i h1 key) in (**) let h2 = ST.get () in (**) assert(preserves_freeable c i state h1 h2); [@inline_let] let total_len = Int.Cast.uint32_to_uint64 (c.init_input_len i) in let tmp: state_s c i t t' = State block_state buf total_len (G.hide S.empty) k' in B.upd state 0ul tmp; (**) let h3 = ST.get () in (**) c.state.frame_invariant B.(loc_buffer state) block_state h2 h3; (**) c.key.frame_invariant B.(loc_buffer state) key h2 h3; (**) optional_frame #_ #i #c.km #c.key B.(loc_buffer state) k' h2 h3; (**) stateful_frame_preserves_freeable B.(loc_buffer state) block_state h2 h3; (**) assert(preserves_freeable c i state h2 h3); // This seems to cause insurmountable difficulties. Puzzled. ST.lemma_equal_domains_trans h1 h2 h3; // AR: 07/22: same old `Seq.equal` and `==` story (**) assert (Seq.equal (seen c i h3 state) Seq.empty); (**) assert (footprint c i h1 state == footprint c i h3 state); (**) assert (B.(modifies (footprint c i h1 state) h1 h3)); (**) assert (U64.v total_len <= U64.v (c.max_input_len i)); (**) begin (**) let key_v = reveal_key c i h3 state in (**) let all_seen_ = all_seen c i h3 state in // SH (11/22): the proof fails if we don't introduce the call to [split_at_last] (**) let blocks, rest = split_at_last c i all_seen_ in (**) let init_input = c.init_input_s i key_v in (**) split_at_last_init c i init_input; (**) assert (invariant_s c i h3 (B.get h3 state 0)) (**) end; (**) assert(preserves_freeable c i state h1 h3) #pop-options /// Some helpers to minimize modulo-reasoning /// ========================================= val split_at_last_num_blocks_lem (#index : Type0) (c: block index) (i: index) (b: nat): Lemma ( let n_blocks = split_at_last_num_blocks c i b in let blocks = n_blocks * U32.v (c.blocks_state_len i) in 0 <= blocks /\ blocks <= b) let split_at_last_num_blocks_lem #index c i b = () /// The ``rest`` function below allows computing, based ``total_len`` stored in /// the state, the length of useful data currently stored in ``buf``. /// Unsurprisingly, there's a fair amount of modulo reasoning here because of /// 64-bit-to-32-bit conversions, so we do them once and for all in a helper. #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let rest #index (c: block index) (i: index) (total_len: UInt64.t): (x:UInt32.t { let n = split_at_last_num_blocks c i (U64.v total_len) in let l = U32.v (c.blocks_state_len i) in 0 <= n * l /\ n * l <= U64.v total_len /\ U32.v x = U64.v total_len - (n * l)}) = let open FStar.Int.Cast in [@inline_let] let l = uint32_to_uint64 (c.blocks_state_len i) in [@inline_let] let r = total_len `U64.rem` l in (**) let total_len_v : Ghost.erased nat = U64.v total_len in (**) let l_v : Ghost.erased nat = U64.v l in (**) let r_v : Ghost.erased nat = U64.v r in (**) assert(Ghost.reveal r_v = total_len_v - ((total_len_v / l_v) * l_v)); (**) Math.Lemmas.euclidean_division_definition total_len_v l_v; (**) assert(Ghost.reveal r_v = total_len_v % l_v); (**) assert(r_v < l_v); if U64.(r =^ uint_to_t 0) && U64.(total_len >^ uint_to_t 0) then begin (**) split_at_last_num_blocks_lem c i (U64.v total_len); c.blocks_state_len i end else begin [@inline_let] let r' = FStar.Int.Cast.uint64_to_uint32 r in (**) FStar.Math.Lemmas.small_modulo_lemma_1 (U64.v r) (pow2 32); (**) calc (==) { (**) U32.v r'; (**) (==) { } (**) U64.v r % pow2 32; (**) (==) { FStar.Math.Lemmas.small_modulo_lemma_1 (U64.v r) (pow2 32) } (**) U64.v r; (**) (==) { FStar.Math.Lemmas.euclidean_division_definition (U64.v total_len) (U64.v (uint32_to_uint64 (c.blocks_state_len i))) } (**) U64.v total_len % U64.v (uint32_to_uint64 (c.blocks_state_len i) ); (**) (==) { } (**) U64.v total_len % U32.v (c.blocks_state_len i); (**) }; (**) assert( (**) let n = split_at_last_num_blocks c i (U64.v total_len) in (**) let l = U32.v (c.blocks_state_len i) in (**) U32.v r' = U64.v total_len - (n * l)); r' end #pop-options /// The ``nblocks`` function below allows computing, given ``total_len`` stored in /// the state, the number of blocks of data which have been processed (the remaining /// unprocessed data being left in ``buf``). #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let nblocks #index (c: block index) (i: index) (len: UInt32.t): (x:UInt32.t { let l = U32.v (c.blocks_state_len i) in U32.v x * l <= U32.v len /\ U32.v x = split_at_last_num_blocks c i (U32.v len) }) = let open FStar.Int.Cast in [@inline_let] let l = c.blocks_state_len i in [@inline_let] let r = rest c i (uint32_to_uint64 len) in (**) let len_v : Ghost.erased nat = U32.v len in (**) let l_v : Ghost.erased nat = U32.v l in (**) let r_v : Ghost.erased nat = U32.v r in (**) let n_s : Ghost.erased nat = split_at_last_num_blocks c i len_v in (**) assert(Ghost.reveal len_v = n_s * l_v + r_v); (**) Math.Lemmas.nat_times_nat_is_nat n_s l_v; (**) assert(U32.v r <= U32.v len); [@inline_let] let blocks = len `U32.sub` r in (**) let blocks_v : Ghost.erased nat = U32.v blocks in (**) assert(blocks_v % l_v = 0); [@inline_let] let n = blocks `U32.div` l in (**) let n_v : Ghost.erased nat = U32.v n in (**) assert(n_v * l_v = Ghost.reveal blocks_v); (**) split_at_last_num_blocks_spec c i len_v n_v r_v; n #pop-options /// The ``rest`` function to call on the unprocessed data length in the ``finish`` /// function. #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let rest_finish #index (c: block index) (i: index) (len: UInt32.t): (x:UInt32.t { let l = U32.v (c.block_len i) in let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem l (U32.v len)) in 0 <= n * l /\ n * l <= U32.v len /\ U32.v x = U32.v len - (n * l)}) = [@inline_let] let l = c.block_len i in [@inline_let] let r = len `U32.rem` l in (**) split_at_last_num_blocks_lem c i (U32.v len); if U32.(r =^ uint_to_t 0) && U32.(len >^ uint_to_t 0) then begin (**) begin (**) let l = U32.v (c.block_len i) in (**) let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem l (U32.v len)) in (**) Math.Lemmas.nat_times_nat_is_nat n l (**) end; c.block_len i end else r #pop-options /// We always add 32-bit lengths to 64-bit lengths. Having a helper for that allows /// doing modulo reasoning once and for all. inline_for_extraction noextract let add_len #index (c: block index) (i: index) (total_len: UInt64.t) (len: UInt32.t): Pure UInt64.t (requires U64.v total_len + U32.v len <= U64.v (c.max_input_len i)) (ensures fun x -> U64.v x = U64.v total_len + U32.v len /\ U64.v x <= U64.v (c.max_input_len i)) = total_len `U64.add` Int.Cast.uint32_to_uint64 len #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let add_len_small #index (c: block index) (i: index) (total_len: UInt64.t) (len: UInt32.t): Lemma (requires U32.v len <= U32.v (c.blocks_state_len i) - U32.v (rest c i total_len) /\ U64.v total_len + U32.v len <= U64.v (c.max_input_len i)) (ensures (rest c i (add_len c i total_len len) = rest c i total_len `U32.add` len)) = let total_len_v = U64.v total_len in let l = U32.v (c.blocks_state_len i) in let b = total_len_v + U32.v len in let n = split_at_last_num_blocks c i total_len_v in let r = U32.v (rest c i total_len) in assert(total_len_v = n * l + r); let r' = U32.v (rest c i total_len) + U32.v len in assert(r' <= l); assert(r' = 0 ==> b = 0); Math.Lemmas.euclidean_division_definition b l; assert(b = n * l + r'); split_at_last_num_blocks_spec c i b n r' #pop-options /// Beginning of the three sub-cases (see Hacl.Streaming.Spec) /// ========================================================== noextract let total_len_h #index (c: block index) (i: index) h (p: state' c i) = State?.total_len (B.deref h p) noextract let split_at_last_all_seen #index (c: block index) (i: index) h (p: state' c i) = let all_seen = all_seen c i h p in let blocks, rest = split_at_last c i all_seen in blocks, rest inline_for_extraction noextract val update_small: #index:Type0 -> (c: block index) -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ U32.v len <= U32.v (c.blocks_state_len i) - U32.v (rest c i (total_len_h c i h0 s))) (ensures fun h0 s' h1 -> update_post c i s data len h0 h1)) /// SH: The proof obligations for update_small have problem succeeding in command /// line mode: hence the restart-solver instruction, the crazy rlimit and the /// intermediate lemma. Interestingly (and frustratingly), the proof succeeds /// quite quickly locally on command-line with this rlimit, but fails with a lower /// one. Besides, the lemma is needed only for the CI regression. let split_at_last_rest_eq (#index : Type0) (c: block index) (i: index) (t:Type0 { t == c.state.s i }) (t':Type0 { t' == optional_key i c.km c.key }) (s: state c i t t') (h0: HS.mem) : Lemma (requires ( invariant c i h0 s)) (ensures ( let s = B.get h0 s 0 in let State block_state buf total_len seen_ k' = s in let key_v = optional_reveal #index #i #c.km #c.key h0 k' in let all_seen = S.append (c.init_input_s i key_v) seen_ in let _, r = split_at_last c i all_seen in let sz = rest c i total_len in Seq.length r == U32.v sz)) = let s = B.get h0 s 0 in let State block_state buf total_len seen_ k' = s in let key_v = optional_reveal #index #i #c.km #c.key h0 k' in let all_seen = S.append (c.init_input_s i key_v) seen_ in let _, r = split_at_last c i all_seen in let sz = rest c i total_len in () /// Particularly difficult proof. Z3 profiling indicates that a pattern goes off /// the rails. So I disabled all of the known "bad" patterns, then did the proof /// by hand. Fortunately, there were only two stateful operations. The idea was /// to do all ofthe modifies-reasoning in the two lemmas above, then disable the /// bad pattern for the main function. /// /// This style is a little tedious, because it requires a little bit of digging /// to understand what needs to hold in order to be able to prove that e.g. the /// sequence remains unmodified from h0 to h2, but this seems more robust? val modifies_footprint: #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in s:state' c i -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( let State _ buf_ _ _ _ = B.deref h0 s in ( update_pre c i s data len h0 /\ B.(modifies (loc_buffer buf_) h0 h1)))) (ensures ( let State bs0 buf0 _ _ k0 = B.deref h0 s in let State bs1 buf1 _ _ k1 = B.deref h1 s in ( footprint c i h0 s == footprint c i h1 s /\ preserves_freeable c i s h0 h1 /\ bs0 == bs1 /\ buf0 == buf1 /\ k0 == k1 /\ c.state.invariant h1 bs1 /\ c.state.v i h1 bs1 == c.state.v i h0 bs0 /\ c.state.footprint h1 bs1 == c.state.footprint h0 bs0 /\ B.(loc_disjoint (loc_addr_of_buffer s) (loc_buffer buf1)) /\ B.(loc_disjoint (loc_addr_of_buffer s) (loc_buffer data)) /\ B.(loc_disjoint (loc_addr_of_buffer s) (loc_addr_of_buffer buf1)) /\ B.(loc_disjoint (loc_addr_of_buffer s) (c.state.footprint h1 bs1)) /\ B.(loc_disjoint (loc_buffer s) (loc_buffer buf1)) /\ B.(loc_disjoint (loc_buffer s) (loc_buffer data)) /\ B.(loc_disjoint (loc_buffer s) (c.state.footprint h1 bs1)) /\ (if c.km = Runtime then c.key.invariant #i h1 k1 /\ c.key.v i h1 k1 == c.key.v i h0 k0 /\ c.key.footprint #i h1 k1 == c.key.footprint #i h0 k0 /\ B.(loc_disjoint (loc_addr_of_buffer s) (c.key.footprint #i h1 k1)) /\ B.(loc_disjoint (loc_buffer s) (c.key.footprint #i h1 k1)) else B.(loc_disjoint (loc_addr_of_buffer s) loc_none) /\ True))))) let modifies_footprint c i p data len h0 h1 = let _ = c.state.frame_freeable #i in let _ = c.key.frame_freeable #i in let s0 = B.deref h0 p in let s1 = B.deref h0 p in let State bs0 buf0 _ _ k0 = s0 in let State bs1 buf0 _ _ k1 = s1 in c.state.frame_invariant (B.loc_buffer buf0) bs0 h0 h1; if c.km = Runtime then c.key.frame_invariant #i (B.loc_buffer buf0) k0 h0 h1 val modifies_footprint': #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in p:state' c i -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( let State bs0 buf0 _ _ k0 = B.deref h0 p in let State bs1 buf1 _ _ k1 = B.deref h1 p in ( B.live h0 p /\ B.(loc_disjoint (loc_addr_of_buffer p) (c.state.footprint #i h0 bs0)) /\ B.(loc_disjoint (loc_addr_of_buffer p) (loc_addr_of_buffer buf0)) /\ c.state.invariant h0 bs0 /\ (if c.km = Runtime then B.(loc_disjoint (loc_addr_of_buffer p) (c.key.footprint #i h0 k0)) /\ c.key.invariant #i h0 k0 else B.(loc_disjoint (loc_addr_of_buffer p) loc_none)) /\ B.(modifies (loc_buffer p) h0 h1)) /\ bs0 == bs1 /\ buf0 == buf1 /\ k0 == k1)) (ensures ( let State bs0 buf0 _ _ k0 = B.deref h0 p in let State bs1 buf1 _ _ k1 = B.deref h1 p in ( B.live h1 p /\ footprint c i h0 p == footprint c i h1 p /\ preserves_freeable c i p h0 h1 /\ B.(loc_disjoint (loc_addr_of_buffer p) (footprint_s c i h1 (B.deref h1 p))) /\ B.(loc_disjoint (loc_addr_of_buffer p) (c.state.footprint #i h1 bs1)) /\ B.(loc_disjoint (loc_buffer p) (c.state.footprint #i h1 bs1)) /\ c.state.invariant h1 bs1 /\ c.state.v i h1 bs1 == c.state.v i h0 bs0 /\ c.state.footprint h1 bs1 == c.state.footprint h0 bs0 /\ (if c.km = Runtime then c.key.invariant #i h1 k1 /\ c.key.v i h1 k1 == c.key.v i h0 k0 /\ c.key.footprint #i h1 k1 == c.key.footprint #i h0 k0 /\ B.(loc_disjoint (loc_addr_of_buffer p) (c.key.footprint #i h1 k1)) /\ B.(loc_disjoint (loc_buffer p) (c.key.footprint #i h1 k1)) else B.(loc_disjoint (loc_addr_of_buffer p) loc_none)))))) let modifies_footprint' c i p data len h0 h1 = let _ = c.state.frame_freeable #i in let _ = c.key.frame_freeable #i in let _ = c.state.frame_invariant #i in let _ = c.key.frame_invariant #i in let _ = allow_inversion key_management in let s0 = B.deref h0 p in let s1 = B.deref h0 p in let State bs0 buf0 _ _ k0 = s0 in let State bs1 buf1 _ _ k1 = s1 in c.state.frame_invariant (B.loc_addr_of_buffer p) bs0 h0 h1; if c.km = Runtime then c.key.frame_invariant #i (B.loc_addr_of_buffer p) k0 h0 h1 /// Small helper which we use to factor out functional correctness proof obligations. /// It states that a state was correctly updated to process some data between two /// memory snapshots (the key is the same, the seen data was updated, etc.). /// /// Note that we don't specify anything about the buffer and the block_state: they /// might have been updated differently depending on the case. unfold val state_is_updated : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Type0) #push-options "--z3cliopt smt.arith.nl=false" let state_is_updated #index c i t t' p data len h0 h1 = // Functional conditions about the memory updates let s0 = B.get h0 p 0 in let s1 = B.get h1 p 0 in let State block_state0 buf0 total_len0 seen0 key0 = s0 in let State block_state1 buf1 total_len1 seen1 key1 = s1 in block_state1 == block_state0 /\ buf1 == buf0 /\ U64.v total_len1 == U64.v total_len0 + U32.v len /\ key1 == key0 /\ seen1 `S.equal` (seen0 `S.append` (B.as_seq h0 data)) /\ optional_reveal #index #i #c.km #c.key h1 key1 == optional_reveal #index #i #c.km #c.key h0 key0 #pop-options /// The functional part of the invariant unfold val invariant_s_funct : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Pure Type0 (requires update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ state_is_updated c i t t' s data len h0 h1) (ensures (fun _ -> True))) let invariant_s_funct #index c i t t' p data len h0 h1 = let blocks, rest = split_at_last_all_seen c i h1 p in let s = B.get h1 p 0 in let State block_state buf_ total_len seen key = s in let key_v = optional_reveal #index #i #c.km #c.key h0 key in let init_s = c.init_s i key_v in (**) Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); c.state.v i h1 block_state == c.update_multi_s i init_s 0 blocks /\ S.equal (S.slice (B.as_seq h1 buf_) 0 (Seq.length rest)) rest /// We isolate the functional correctness proof obligations for [update_small] val update_small_functional_correctness : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( // The precondition of [small_update] update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ U32.v len <= U32.v (c.blocks_state_len i) - U32.v (rest c i (total_len_h c i h0 s)) /\ // Generic conditions state_is_updated c i t t' s data len h0 h1 /\ // Functional conditions about the memory updates begin let s0 = B.get h0 s 0 in let s1 = B.get h1 s 0 in let State block_state0 buf0 total_len0 seen0 key0 = s0 in let State block_state1 buf1 total_len1 seen1 key1 = s1 in let sz = rest c i total_len0 in let buf = buf0 in let data_v0 = B.as_seq h0 data in let buf_beg_v0 = S.slice (B.as_seq h0 buf) 0 (U32.v sz) in let buf_part_v1 = S.slice (B.as_seq h1 buf) 0 (U32.v sz + U32.v len) in buf_part_v1 == S.append buf_beg_v0 data_v0 /\ c.state.v i h1 block_state1 == c.state.v i h0 block_state0 end )) (ensures (invariant_s_funct c i t t' s data len h0 h1))) #push-options "--z3cliopt smt.arith.nl=false" let update_small_functional_correctness #index c i t t' p data len h0 h1 = let s0 = B.get h0 p 0 in let s1 = B.get h1 p 0 in let State block_state buf total_len0 seen0 key = s0 in let seen0 = G.reveal seen0 in let i = Ghost.reveal i in let key_v0 = optional_reveal #_ #i #c.km #c.key h0 key in let init_v0 = c.init_input_s i key_v0 in let all_seen0 = S.append init_v0 seen0 in let blocks0, rest0 = split_at_last c i all_seen0 in let State block_state buf total_len1 seen1 key = s1 in let seen1 = G.reveal seen1 in let i = Ghost.reveal i in let key_v1 = optional_reveal #_ #i #c.km #c.key h1 key in assert(key_v1 == key_v0); let init_v1 = c.init_input_s i key_v1 in assert(init_v1 == init_v0); let all_seen1 = S.append init_v1 seen1 in let blocks1, rest1 = split_at_last c i all_seen1 in (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.block_len c i)); (**) assert(0 % U32.v (Block?.block_len c i) = 0); (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.blocks_state_len c i)); (**) assert(0 % U32.v (Block?.blocks_state_len c i) = 0); let data_v0 = B.as_seq h0 data in split_at_last_small c i all_seen0 data_v0; // The first problematic condition assert(blocks1 `S.equal` blocks0); assert(c.state.v i h1 block_state == c.update_multi_s i (c.init_s i key_v1) 0 blocks1); // The second problematic condition assert(S.equal (S.slice (B.as_seq h1 buf) 0 (Seq.length rest1)) rest1) #pop-options // The absence of loc_disjoint_includes makes reasoning a little more difficult. // Notably, we lose all of the important disjointness properties between the // outer point p and the buffer within B.deref h p. These need to be // re-established by hand. Another thing that we lose without this pattern is // knowing that loc_buffer b is included within loc_addr_of_buffer b. This is // important for reasoning about the preservation of e.g. the contents of data. #restart-solver #push-options "--z3rlimit 300 --z3cliopt smt.arith.nl=false --z3refresh \ --using_facts_from '*,-LowStar.Monotonic.Buffer.unused_in_not_unused_in_disjoint_2,-FStar.Seq.Properties.slice_slice,-LowStar.Monotonic.Buffer.loc_disjoint_includes_r'" let update_small #index c i t t' p data len = let open LowStar.BufferOps in let s = !*p in let State block_state buf total_len seen_ k' = s in [@inline_let] let block_state: c.state.s i = block_state in // Functional reasoning. let sz = rest c i total_len in add_len_small c i total_len len; let h0 = ST.get () in let buf1 = B.sub buf 0ul sz in let buf2 = B.sub buf sz len in // Memory reasoning. c.state.invariant_loc_in_footprint h0 block_state; if c.km = Runtime then c.key.invariant_loc_in_footprint #i h0 k'; // key_invariant_loc_in_footprint #index c i h0 p; B.(loc_disjoint_includes_r (loc_buffer data) (footprint c i h0 p) (loc_buffer buf2)); // FIRST STATEFUL OPERATION B.blit data 0ul buf2 0ul len; // Memory reasoning. let h1 = ST.get () in modifies_footprint c i p data len h0 h1; c.state.invariant_loc_in_footprint h1 block_state; if c.km = Runtime then c.key.invariant_loc_in_footprint #i h1 k'; // Functional reasoning on data begin let buf1_v0 = B.as_seq h0 buf1 in let buf1_v1 = B.as_seq h1 buf1 in let buf2_v1 = B.as_seq h1 buf2 in let buf_beg_v0 = S.slice (B.as_seq h0 buf) 0 (U32.v sz) in let buf_part_v1 = S.slice (B.as_seq h1 buf) 0 (U32.v sz + U32.v len) in let data_v0 = B.as_seq h0 data in assert(buf1_v1 == buf1_v0); assert(buf1_v0 == buf_beg_v0); assert(buf2_v1 `S.equal` data_v0); assert(buf_part_v1 `S.equal` S.append buf_beg_v0 data_v0) end; // SECOND STATEFUL OPERATION let total_len = add_len c i total_len len in [@inline_let] let tmp: state_s c i t t' = State #index #c #i block_state buf total_len (G.hide (G.reveal seen_ `S.append` (B.as_seq h0 data))) k' in p *= tmp; // Memory reasoning. let h2 = ST.get () in modifies_footprint' c i p data len h1 h2; c.state.invariant_loc_in_footprint h2 block_state; if c.km = Runtime then c.key.invariant_loc_in_footprint #i h2 k'; ST.lemma_equal_domains_trans h0 h1 h2; // Prove the invariant update_small_functional_correctness c i t t' p data len h0 h2 #pop-options // Stupid name collisions noextract let seen_h = seen noextract let all_seen_h = all_seen /// Case 2: we have no buffered data (ie: the buffer was just initialized), or the /// internal buffer is full meaning that we can just hash it to go to the case where /// there is no buffered data. Of course, the data we append has to be non-empty, /// otherwise we might end-up with an empty internal buffer. /// Auxiliary lemma which groups the functional correctness proof obligations /// for [update_empty_or_full]. #push-options "--z3cliopt smt.arith.nl=false" val update_empty_or_full_functional_correctness : #index:Type0 -> c:block index -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer Lib.IntTypes.uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( // Same precondition as [update_empty_or_full_buf] update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ (rest c i (total_len_h c i h0 s) = 0ul \/ rest c i (total_len_h c i h0 s) = c.blocks_state_len i) /\ U32.v len > 0 /\ // Generic additional preconditions state_is_updated c i t t' s data len h0 h1 /\ // Additional preconditions begin let s0 = B.get h0 s 0 in let s1 = B.get h1 s 0 in let State block_state0 buf0 total_len0 seen0 key0 = s0 in let State block_state1 buf1 total_len1 seen1 key1 = s1 in let seen0 = G.reveal seen0 in let seen1 = G.reveal seen1 in let block_state = block_state0 in let buf = buf0 in let n_blocks = nblocks c i len in (**) split_at_last_num_blocks_lem c i (U32.v len); (**) assert(U32.v n_blocks * U32.v (c.blocks_state_len i) <= U32.v len); (**) assert(U32.(FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n)); let data1_len = n_blocks `U32.mul` c.blocks_state_len i in let data2_len = len `U32.sub` data1_len in let data1 = B.gsub data 0ul data1_len in let data2 = B.gsub data data1_len data2_len in let all_seen0 = all_seen c i h0 s in let all_seen1 = all_seen c i h1 s in let blocks0, res0 = split_at_last c i all_seen0 in let blocks1, res1 = split_at_last c i all_seen1 in let data1_v = B.as_seq h0 data1 in let data2_v = B.as_seq h0 data2 in let key = optional_reveal #index #i #c.km #c.key h0 key0 in let init_s = c.init_s i key in let all_seen_data1 = S.append all_seen0 data1_v in (**) Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); S.length all_seen0 % U32.v (c.block_len i) = 0 /\ // TODO: should be proved automatically S.length all_seen_data1 % U32.v (c.block_len i) = 0 /\ // TODO: should be proved automatically c.state.v i h1 block_state == c.update_multi_s i init_s 0 all_seen_data1 /\ S.slice (B.as_seq h1 buf) 0 (Seq.length data2_v) `S.equal` data2_v /\ True end /\ True )) (ensures (invariant_s_funct c i t t' s data len h0 h1))) #pop-options #push-options "--z3cliopt smt.arith.nl=false" let update_empty_or_full_functional_correctness #index c i t t' p data len h0 h1 = let s = B.get h0 p 0 in let State block_state buf_ total_len seen0 key = s in let init_s = c.init_s i (optional_reveal #index #i #c.km #c.key h0 key) in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); let n_blocks = nblocks c i len in (**) split_at_last_num_blocks_lem c i (U32.v len); (**) assert(U32.(FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n)); let data1_len = n_blocks `U32.mul` c.blocks_state_len i in let data2_len = len `U32.sub` data1_len in let data1 = B.gsub data 0ul data1_len in let data2 = B.gsub data data1_len data2_len in let data_v = B.as_seq h0 data in let init_input = init_input c i h0 p in let seen1 = seen c i h1 p in let all_seen0 = all_seen c i h0 p in let all_seen1 = all_seen c i h1 p in let blocks0, rest0 = split_at_last_all_seen c i h0 p in let blocks1, rest1 = split_at_last_all_seen c i h1 p in let data_blocks, data_rest = split_at_last c i data_v in split_at_last_blocks c i all_seen0 data_v; assert(Seq.equal all_seen1 (S.append all_seen0 data_v)); assert(S.equal blocks1 (S.append all_seen0 data_blocks)); assert(S.equal data_rest rest1) #pop-options inline_for_extraction noextract val update_empty_or_full_buf: #index:Type0 -> c:block index -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer Lib.IntTypes.uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ (rest c i (total_len_h c i h0 s) = 0ul \/ rest c i (total_len_h c i h0 s) = c.blocks_state_len i) /\ U32.v len > 0) (ensures fun h0 s' h1 -> update_post c i s data len h0 h1)) #push-options "--z3cliopt smt.arith.nl=false --z3rlimit 500" let update_empty_or_full_buf #index c i t t' p data len = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in [@inline_let] let _ = c.update_multi_associative i in let open LowStar.BufferOps in let s = !*p in let State block_state buf total_len seen k' = s in [@inline_let] let block_state: c.state.s i = block_state in let sz = rest c i total_len in let h0 = ST.get () in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert(0 % U32.v (c.block_len i) = 0); let init_key : Ghost.erased _ = optional_reveal h0 (k' <: optional_key i c.km c.key) in let init_state : Ghost.erased _ = c.init_s i init_key in assert( let all_seen = all_seen c i h0 p in let blocks, rest = split_at_last c i all_seen in Seq.length rest = U32.v sz /\ c.state.v i h0 block_state == c.update_multi_s i init_state 0 blocks); (* Start by "flushing" the buffer: hash it so that all the data seen so far * has been processed and we can consider the buffer as empty *) if U32.(sz =^ 0ul) then begin assert( let all_seen = all_seen c i h0 p in c.state.v i h0 block_state == c.update_multi_s i init_state 0 all_seen) end else begin let prevlen = U64.(total_len `sub` FStar.Int.Cast.uint32_to_uint64 sz) in c.update_multi (G.hide i) block_state prevlen buf (c.blocks_state_len i); begin let h1 = ST.get () in let all_seen = all_seen c i h0 p in let blocks, rest = split_at_last c i all_seen in assert(Seq.length blocks = U64.v prevlen); assert(c.state.v i h0 block_state == c.update_multi_s i init_state 0 blocks); assert(c.state.v i h1 block_state == c.update_multi_s i (c.update_multi_s i init_state 0 blocks) (U64.v prevlen) rest); assert(all_seen `Seq.equal` Seq.append blocks rest); (* TODO: the pattern of ``update_multi_associative`` is not triggered *) c.update_multi_associative i init_state 0 (U64.v prevlen) blocks rest; assert(c.state.v i h1 block_state == c.update_multi_s i init_state 0 all_seen) end end; let h1 = ST.get () in assert( let all_seen = all_seen c i h0 p in c.state.v i h1 block_state == c.update_multi_s i init_state 0 all_seen); split_at_last_blocks c i (all_seen c i h0 p) (B.as_seq h0 data); // TODO: remove? let n_blocks = nblocks c i len in (**) split_at_last_num_blocks_lem c i (U32.v len); (**) assert(U32.(FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n)); let data1_len = n_blocks `U32.mul` c.blocks_state_len i in let data2_len = len `U32.sub` data1_len in let data1 = B.sub data 0ul data1_len in let data2 = B.sub data data1_len data2_len in c.update_multi (G.hide i) block_state total_len data1 data1_len; let h01 = ST.get () in optional_frame #_ #i #c.km #c.key (c.state.footprint h0 block_state) k' h0 h01; assert(preserves_freeable c i p h0 h01); begin let all_seen = all_seen c i h0 p in let data1_v = B.as_seq h01 data1 in c.update_multi_associative i init_state 0 (Seq.length all_seen) all_seen data1_v; assert(c.state.v i h01 block_state == c.update_multi_s i init_state 0 (Seq.append all_seen data1_v)) end; let dst = B.sub buf 0ul data2_len in let h1 = ST.get () in B.blit data2 0ul dst 0ul data2_len; let h2 = ST.get () in c.state.frame_invariant (B.loc_buffer buf) block_state h1 h2; optional_frame #_ #i #c.km #c.key (B.loc_buffer buf) k' h1 h2; stateful_frame_preserves_freeable #index #(Block?.state c) #i (B.loc_buffer dst) (State?.block_state s) h1 h2; assert(preserves_freeable c i p h01 h2); [@inline_let] let total_len' = add_len c i total_len len in [@inline_let] let tmp: state_s c i t t' = State #index #c #i block_state buf total_len' (seen `S.append` B.as_seq h0 data) k' in p *= tmp; let h3 = ST.get () in c.state.frame_invariant (B.loc_buffer p) block_state h2 h3; optional_frame #_ #i #c.km #c.key (B.loc_buffer p) k' h2 h3; stateful_frame_preserves_freeable #index #(Block?.state c) #i (B.loc_buffer p) (State?.block_state s) h2 h3; assert(preserves_freeable c i p h2 h3); assert(preserves_freeable c i p h0 h3); update_empty_or_full_functional_correctness #index c i t t' p data len h0 h3; (* The following proof obligation is the difficult one - keep it here for * easy debugging when updating the definitions/proofs *) assert(invariant_s c i h3 (B.get h3 p 0)) #pop-options /// Case 3: we are given just enough data to end up on the boundary. It is just /// a sub-case of [update_small], but with a little bit more precise pre and post /// conditions. inline_for_extraction noextract val update_round: #index:Type0 -> c:block index -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ ( let r = rest c i (total_len_h c i h0 s) in U32.v len + U32.v r = U32.v (c.blocks_state_len i) /\ r <> 0ul)) (ensures fun h0 _ h1 -> update_post c i s data len h0 h1 /\ begin let blocks, rest = split_at_last_all_seen c i h0 s in let blocks', rest' = split_at_last_all_seen c i h1 s in blocks' `S.equal` blocks /\ rest' `S.equal` S.append rest (B.as_seq h0 data) /\ S.length rest' = U32.v (c.blocks_state_len i) end)) #push-options "--z3rlimit 200 --z3cliopt smt.arith.nl=false" let update_round #index c i t t' p data len = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.update_multi_associative i in let open LowStar.BufferOps in (**) let h0 = ST.get() in update_small #index c i t t' p data len; (**) let h1 = ST.get() in (**) split_at_last_small c i (all_seen c i h0 p) (B.as_seq h0 data); (**) begin // For some reason, the proof fails if we don't call those (**) let blocks, rest = split_at_last_all_seen c i h0 p in (**) let blocks', rest' = split_at_last_all_seen c i h1 p in (**) () (**) end #pop-options /// General update function, as a decomposition of the three sub-cases /// ================================================================== #push-options "--z3rlimit 200" let update #index c i t t' state chunk chunk_len = let open LowStar.BufferOps in let s = !*state in let State block_state buf_ total_len seen k' = s in let i = c.index_of_state i block_state in if FStar.UInt64.(FStar.Int.Cast.uint32_to_uint64 chunk_len >^ c.max_input_len i -^ total_len) then Hacl.Streaming.Types.MaximumLengthExceeded else let sz = rest c i total_len in if chunk_len `U32.lte` (c.blocks_state_len i `U32.sub` sz) then update_small c i t t' state chunk chunk_len else if sz = 0ul then update_empty_or_full_buf c i t t' state chunk chunk_len else begin let h0 = ST.get () in let diff = c.blocks_state_len i `U32.sub` sz in let chunk1 = B.sub chunk 0ul diff in let chunk2 = B.sub chunk diff (chunk_len `U32.sub` diff) in update_round c i t t' state chunk1 diff; let h1 = ST.get () in update_empty_or_full_buf c i t t' state chunk2 (chunk_len `U32.sub` diff); let h2 = ST.get () in ( let seen = G.reveal seen in assert (seen_h c i h1 state `S.equal` (S.append seen (B.as_seq h0 chunk1))); assert (seen_h c i h2 state `S.equal` (S.append (S.append seen (B.as_seq h0 chunk1)) (B.as_seq h0 chunk2))); S.append_assoc seen (B.as_seq h0 chunk1) (B.as_seq h0 chunk2); assert (S.equal (S.append (B.as_seq h0 chunk1) (B.as_seq h0 chunk2)) (B.as_seq h0 chunk)); assert (S.equal (S.append (S.append seen (B.as_seq h0 chunk1)) (B.as_seq h0 chunk2)) (S.append seen (B.as_seq h0 chunk))); assert (seen_h c i h2 state `S.equal` (S.append seen (B.as_seq h0 chunk))); () ) end; Hacl.Streaming.Types.Success #pop-options #push-options "--z3cliopt smt.arith.nl=false" val digest_process_begin_functional_correctness : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> dst:B.buffer uint8 -> l: c.output_length_t { B.length dst == c.output_length i l } -> h0: HS.mem -> h1: HS.mem -> tmp_block_state: t -> Lemma (requires ( // The precondition of [digest] invariant c i h0 s /\ c.state.invariant #i h1 tmp_block_state /\ begin let s = B.get h0 s 0 in let State block_state buf_ total_len seen key = s in let r = rest c i total_len in (**) assert(U32.v r <= U64.v total_len); let prev_len = U64.(total_len `sub` FStar.Int.Cast.uint32_to_uint64 r) in let r_last = rest_finish c i r in (**) assert(U32.v r_last <= U32.v r); let r_multi = U32.(r -^ r_last) in let buf_multi = B.gsub buf_ 0ul r_multi in let prev_length = U64.v prev_len in let k = optional_reveal #_ #i #c.km #c.key h0 key in c.state.v i h1 tmp_block_state == c.update_multi_s i (c.state.v i h0 block_state) prev_length (B.as_seq h0 buf_multi) end)) (ensures ( let all_seen = all_seen c i h0 s in let s = B.get h0 s 0 in let State block_state buf_ total_len seen key = s in let block_length = U32.v (c.block_len i) in let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem block_length (S.length all_seen)) in let k = optional_reveal #_ #i #c.km #c.key h0 key in let init_state = c.init_s i k in (**) Math.Lemmas.modulo_lemma 0 block_length; (**) Math.Lemmas.cancel_mul_mod n block_length; (**) Math.Lemmas.nat_times_nat_is_nat n block_length; (**) split_at_last_num_blocks_lem c i (S.length all_seen); 0 % block_length = 0 /\ 0 <= n * block_length /\ (n * block_length) % block_length = 0 /\ c.state.v i h1 tmp_block_state == c.update_multi_s i init_state 0 (S.slice all_seen 0 (n * block_length))) )) #pop-options #push-options "--z3cliopt smt.arith.nl=false" let digest_process_begin_functional_correctness #index c i t t' p dst l h0 h1 tmp_block_state = let h3 = h0 in let h4 = h1 in let s = B.get h0 p 0 in let State block_state buf_ total_len seen k' = s in let r = rest c i total_len in let buf_ = B.gsub buf_ 0ul r in let prev_len = U64.(total_len `sub` FStar.Int.Cast.uint32_to_uint64 r) in let r_last = rest_finish c i r in let r_multi = U32.(r -^ r_last) in let i = G.reveal i in let all_seen = all_seen c i h0 p in let block_length = U32.v (c.block_len i) in let blocks_state_length = U32.v (c.blocks_state_len i) in let k = optional_reveal #_ #i #c.km #c.key h0 k' in let prev_length = U64.v prev_len in let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem block_length (S.length all_seen)) in let init_state = c.init_s i k in Math.Lemmas.modulo_lemma 0 block_length; Math.Lemmas.cancel_mul_mod n block_length; assert(prev_length + U32.v r = U64.v total_len); assert(U32.v r_multi <= U32.v r); assert(prev_length + U32.v r_multi <= U64.v total_len); assert(n * block_length <= U64.v total_len); let buf_multi = B.gsub buf_ 0ul r_multi in assert( c.state.v i h4 tmp_block_state == c.update_multi_s i (c.state.v i h0 block_state) prev_length (B.as_seq h3 buf_multi)); assert( B.as_seq h3 buf_multi == S.slice all_seen prev_length (prev_length + U32.v r_multi)); assert( c.state.v i h4 tmp_block_state == c.update_multi_s i (c.update_multi_s i init_state 0 (S.slice all_seen 0 prev_length)) prev_length (S.slice all_seen prev_length (prev_length + U32.v r_multi))); assert(0 % block_length = 0); assert(S.length (S.slice all_seen 0 prev_length) % block_length = 0); assert(prev_length + U32.v r_multi <= S.length all_seen); c.update_multi_associative i init_state 0 prev_length (S.slice all_seen 0 prev_length) (S.slice all_seen prev_length (prev_length + U32.v r_multi)); assert( S.equal (S.append (S.slice all_seen 0 prev_length) (S.slice all_seen prev_length (prev_length + U32.v r_multi))) (S.slice all_seen 0 (prev_length + U32.v r_multi))); assert( c.state.v i h4 tmp_block_state == c.update_multi_s i init_state 0 (S.slice all_seen 0 (prev_length + U32.v r_multi))); split_at_last_finish c i all_seen; Math.Lemmas.nat_times_nat_is_nat n block_length; assert(0 <= n * block_length); assert(n * block_length <= S.length all_seen); assert( c.state.v i h4 tmp_block_state == c.update_multi_s i init_state 0 (S.slice all_seen 0 (n * block_length))) #pop-options #restart-solver
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Ignore.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.UpdateMulti.fst.checked", "Lib.IntTypes.fsti.checked", "Hacl.Streaming.Types.fst.checked", "Hacl.Streaming.Spec.fst.checked", "Hacl.Streaming.Interface.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.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.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Streaming.Functor.fst" }
[ { "abbrev": false, "full_module": "Hacl.Streaming.Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Streaming.Interface", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Streaming.Interface", "short_module": "I" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Seq", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Ghost", "short_module": "G" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Streaming", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Streaming", "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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "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": [ "smt.arith.nl=false" ], "z3refresh": false, "z3rlimit": 200, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c: Hacl.Streaming.Interface.block index -> i: index -> t: Type0{t == Stateful?.s (Block?.state c) i} -> t': Type0 { t' == Hacl.Streaming.Interface.optional_key (FStar.Ghost.reveal (FStar.Ghost.hide i)) (Block?.km c) (Block?.key c) } -> Hacl.Streaming.Functor.digest_st c i t t'
Prims.Tot
[ "total" ]
[]
[ "Hacl.Streaming.Interface.block", "Prims.eq2", "Hacl.Streaming.Interface.__proj__Stateful__item__s", "Hacl.Streaming.Interface.__proj__Block__item__state", "Hacl.Streaming.Interface.optional_key", "FStar.Ghost.reveal", "FStar.Ghost.hide", "Hacl.Streaming.Interface.__proj__Block__item__km", "Hacl.Streaming.Interface.__proj__Block__item__key", "Hacl.Streaming.Functor.state", "LowStar.Buffer.buffer", "Hacl.Streaming.Spec.uint8", "Hacl.Streaming.Interface.__proj__Block__item__output_length_t", "Prims.nat", "LowStar.Monotonic.Buffer.length", "LowStar.Buffer.trivial_preorder", "Hacl.Streaming.Interface.__proj__Block__item__output_length", "Lib.IntTypes.uint8", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "Hacl.Streaming.Interface.__proj__Block__item__blocks_state_len", "FStar.UInt64.t", "FStar.Ghost.erased", "FStar.Seq.Base.seq", "Prims._assert", "LowStar.Monotonic.Buffer.modifies", "Prims.unit", "LowStar.Monotonic.Buffer.popped_modifies", "LowStar.Monotonic.Buffer.modifies_remove_fresh_frame", "LowStar.Monotonic.Buffer.loc", "LowStar.Monotonic.Buffer.loc_union", "LowStar.Monotonic.Buffer.loc_buffer", "Hacl.Streaming.Functor.footprint", "FStar.Seq.Base.equal", "Hacl.Streaming.Functor.seen_h", "Hacl.Streaming.Functor.optional_frame", "LowStar.Monotonic.Buffer.loc_region_only", "FStar.Monotonic.HyperStack.get_tip", "Hacl.Streaming.Functor.stateful_frame_preserves_freeable", "Hacl.Streaming.Interface.__proj__Stateful__item__frame_invariant", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "FStar.HyperStack.ST.pop_frame", "Hacl.Streaming.Interface.__proj__Stateful__item__footprint", "Lib.UpdateMulti.uint8", "FStar.Calc.calc_finish", "LowStar.Monotonic.Buffer.as_seq", "Hacl.Streaming.Interface.__proj__Block__item__spec_s", "Prims.Cons", "FStar.Preorder.relation", "Hacl.Streaming.Interface.uint8", "Prims.Nil", "FStar.Calc.calc_step", "Hacl.Streaming.Interface.__proj__Block__item__finish_s", "Hacl.Streaming.Interface.__proj__Block__item__update_last_s", "Hacl.Streaming.Interface.__proj__Block__item__update_multi_s", "Hacl.Streaming.Interface.__proj__Block__item__init_s", "FStar.Seq.Base.slice", "FStar.Mul.op_Star", "Hacl.Streaming.Interface.__proj__Stateful__item__v", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "Prims.squash", "Hacl.Streaming.Interface.__proj__Block__item__spec_is_incremental", "Prims.int", "Prims.op_Modulus", "FStar.UInt32.v", "Hacl.Streaming.Interface.__proj__Block__item__block_len", "FStar.Math.Lemmas.modulo_lemma", "Hacl.Streaming.Interface.__proj__Stateful__item__t", "Hacl.Streaming.Functor.optional_reveal", "FStar.Pervasives.Native.tuple2", "Lib.UpdateMulti.split_at_last_lazy", "FStar.Pervasives.Native.fst", "Lib.UpdateMulti.split_at_last_lazy_nb_rem", "FStar.Seq.Base.length", "FStar.UInt.uint_t", "Hacl.Streaming.Functor.bytes", "Hacl.Streaming.Functor.all_seen", "Hacl.Streaming.Interface.__proj__Block__item__finish", "Hacl.Streaming.Interface.__proj__Block__item__update_last", "FStar.UInt64.v", "FStar.Math.Lemmas.modulo_distributivity", "Prims.op_Addition", "FStar.UInt64.sub", "FStar.Int.Cast.uint32_to_uint64", "Prims.op_LessThanOrEqual", "Hacl.Streaming.Spec.split_at_last_finish", "Hacl.Streaming.Functor.digest_process_begin_functional_correctness", "Hacl.Streaming.Interface.__proj__Block__item__update_multi", "Prims.bool", "Prims.l_and", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.Integers.int_t", "FStar.Integers.Signed", "FStar.Integers.Winfinite", "Hacl.Streaming.Interface.__proj__Block__item__max_input_len", "FStar.UInt32.__uint_to_t", "FStar.UInt32.n", "FStar.Integers.op_Less_Equals", "FStar.Integers.op_Plus", "Prims.l_imp", "Prims.op_Subtraction", "Hacl.Streaming.Spec.split_at_last_num_blocks", "FStar.Integers.op_Greater", "FStar.Integers.op_Greater_Equals", "FStar.Integers.op_Percent", "LowStar.Monotonic.Buffer.mbuffer", "Lib.IntTypes.int_t", "Lib.IntTypes.U8", "Lib.IntTypes.SEC", "LowStar.Buffer.sub", "FStar.UInt32.op_Subtraction_Hat", "Prims.op_Multiply", "Hacl.Streaming.Functor.rest_finish", "Hacl.Streaming.Interface.__proj__Stateful__item__copy", "LowStar.Monotonic.Buffer.loc_none", "LowStar.Monotonic.Buffer.modifies_only_not_unused_in", "LowStar.Monotonic.Buffer.loc_disjoint", "Hacl.Streaming.Interface.__proj__Stateful__item__alloca", "Hacl.Streaming.Functor.rest", "FStar.HyperStack.ST.push_frame", "Hacl.Streaming.Functor.state_s", "LowStar.BufferOps.op_Bang_Star", "FStar.Pervasives.allow_inversion", "Hacl.Streaming.Interface.key_management", "FStar.Seq.Base.append", "FStar.Pervasives.pattern", "FStar.Pervasives.smt_pat", "Hacl.Streaming.Interface.__proj__Block__item__update_multi_associative", "Hacl.Streaming.Interface.__proj__Stateful__item__invariant", "LowStar.Monotonic.Buffer.loc_in", "Hacl.Streaming.Interface.__proj__Stateful__item__invariant_loc_in_footprint" ]
[]
false
false
false
false
false
let digest #index c i t t' state output l =
[@@ inline_let ]let _ = c.state.invariant_loc_in_footprint #i in [@@ inline_let ]let _ = c.key.invariant_loc_in_footprint #i in [@@ inline_let ]let _ = c.update_multi_associative i in [@@ inline_let ]let _ = allow_inversion key_management in let open LowStar.BufferOps in let h0 = ST.get () in let State block_state buf_ total_len seen k' = !*state in push_frame (); let h1 = ST.get () in c.state.frame_invariant #i B.loc_none block_state h0 h1; stateful_frame_preserves_freeable #index #c.state #i B.loc_none block_state h0 h1; optional_frame #_ #i #c.km #c.key B.loc_none k' h0 h1; let r = rest c i total_len in let buf_ = B.sub buf_ 0ul r in let tmp_block_state = c.state.alloca i in let h2 = ST.get () in assert (let open B in loc_disjoint (c.state.footprint #i h2 tmp_block_state) (c.state.footprint #i h1 block_state)); B.modifies_only_not_unused_in B.loc_none h1 h2; c.state.frame_invariant #i B.loc_none block_state h1 h2; stateful_frame_preserves_freeable #index #c.state #i B.loc_none block_state h1 h2; optional_frame #_ #i #c.km #c.key B.loc_none k' h1 h2; c.state.copy (G.hide i) block_state tmp_block_state; let h3 = ST.get () in c.state.frame_invariant #i (c.state.footprint h2 tmp_block_state) block_state h2 h3; stateful_frame_preserves_freeable #index #c.state #i (c.state.footprint h2 tmp_block_state) block_state h2 h3; optional_frame #_ #i #c.km #c.key (c.state.footprint h2 tmp_block_state) k' h2 h3; let prev_len = let open U64 in total_len `sub` (FStar.Int.Cast.uint32_to_uint64 r) in [@@ inline_let ]let r_last = rest_finish c i r in [@@ inline_let ]let r_multi = let open U32 in r -^ r_last in let buf_last = B.sub buf_ r_multi (Ghost.hide r_last) in let buf_multi = B.sub buf_ 0ul r_multi in [@@ inline_let ]let state_is_block = c.block_len i = c.blocks_state_len i in assert (state_is_block ==> U32.v r_multi = 0); assert (state_is_block ==> r_last = r); [@@ inline_let ]let r_multi = if state_is_block then 0ul else r_multi in [@@ inline_let ]let r_last = if state_is_block then r else r_last in c.update_multi (G.hide i) tmp_block_state prev_len buf_multi r_multi; let h4 = get () in optional_frame #_ #i #c.km #c.key (c.state.footprint #i h3 tmp_block_state) k' h3 h4; digest_process_begin_functional_correctness #index c i t t' state output l h0 h4 tmp_block_state; split_at_last_finish c i (all_seen c i h0 state); assert (UInt32.v r_last <= UInt32.v (Block?.block_len c (Ghost.reveal (Ghost.hide i)))); let prev_len_last = let open U64 in total_len `sub` (FStar.Int.Cast.uint32_to_uint64 r_last) in (assert (U64.v prev_len_last = U64.v prev_len + U32.v r_multi); Math.Lemmas.modulo_distributivity (U64.v prev_len) (U32.v r_multi) (U32.v (c.block_len i)); Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert (U64.v prev_len_last % U32.v (c.block_len i) = 0)); c.update_last (G.hide i) tmp_block_state prev_len_last buf_last r_last; let h5 = ST.get () in c.state.frame_invariant #i (c.state.footprint h3 tmp_block_state) block_state h3 h5; stateful_frame_preserves_freeable #index #c.state #i (c.state.footprint h3 tmp_block_state) block_state h3 h5; optional_frame #_ #i #c.km #c.key (c.state.footprint h3 tmp_block_state) k' h3 h5; c.finish (G.hide i) k' tmp_block_state output l; let h6 = ST.get () in (let r = r_last in let all_seen = all_seen c i h0 state in let blocks_state_length = U32.v (c.blocks_state_len i) in let block_length = U32.v (c.block_len i) in let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem block_length (S.length all_seen)) in let blocks, rest_ = Lib.UpdateMulti.split_at_last_lazy block_length all_seen in let k = optional_reveal #_ #i #c.km #c.key h0 k' in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert (0 % U32.v (c.block_len i) = 0); assert (B.as_seq h3 buf_last == rest_); calc (S.equal) { B.as_seq h6 output; (S.equal) { () } c.finish_s i k (c.state.v i h5 tmp_block_state) l; (S.equal) { () } c.finish_s i k (c.update_last_s i (c.state.v i h4 tmp_block_state) (n * block_length) (B.as_seq h4 buf_last)) l; (S.equal) { () } c.finish_s i k (c.update_last_s i (c.state.v i h4 tmp_block_state) (n * block_length) rest_) l; (S.equal) { () } c.finish_s i k (c.update_last_s i (c.update_multi_s i (c.init_s i k) 0 (S.slice all_seen 0 (n * block_length))) (n * block_length) rest_) l; (S.equal) { c.spec_is_incremental i k seen l } c.spec_s i k seen l; }); c.state.frame_invariant #i B.((loc_buffer output) `loc_union` (c.state.footprint h5 tmp_block_state)) block_state h5 h6; stateful_frame_preserves_freeable #index #c.state #i B.((loc_buffer output) `loc_union` (c.state.footprint h5 tmp_block_state)) block_state h5 h6; optional_frame #_ #i #c.km #c.key B.((loc_buffer output) `loc_union` (c.state.footprint h5 tmp_block_state)) k' h5 h6; pop_frame (); let h7 = ST.get () in c.state.frame_invariant #i B.(loc_region_only false (HS.get_tip h6)) block_state h6 h7; stateful_frame_preserves_freeable #index #c.state #i B.(loc_region_only false (HS.get_tip h6)) block_state h6 h7; optional_frame #_ #i #c.km #c.key B.(loc_region_only false (HS.get_tip h6)) k' h6 h7; assert ((seen_h c i h7 state) `S.equal` (G.reveal seen)); let mloc = B.loc_union (B.loc_buffer output) (footprint c i h0 state) in B.modifies_remove_fresh_frame h0 h1 h7 mloc; B.popped_modifies h6 h7; assert (let open B in modifies mloc h0 h7)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Cmovc64
val va_lemma_Cmovc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Cmovc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (if Vale.X64.Decls.cf (va_get_flags va_sM) then (va_eval_dst_opr64 va_sM dst = va_eval_opr64 va_s0 src) else (va_eval_dst_opr64 va_sM dst = va_eval_dst_opr64 va_s0 dst)) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
val va_lemma_Cmovc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Cmovc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (if Vale.X64.Decls.cf (va_get_flags va_sM) then (va_eval_dst_opr64 va_sM dst = va_eval_opr64 va_s0 src) else (va_eval_dst_opr64 va_sM dst = va_eval_dst_opr64 va_s0 dst)) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 59, "start_col": 0, "start_line": 54 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cmovc64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Cmovc64" ]
[]
false
false
false
false
false
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Adx_Bmi2
val va_codegen_success_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 677, "start_col": 0, "start_line": 676 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Avx
val va_code_Cpuid_Avx : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Avx : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 705, "start_col": 0, "start_line": 704 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_IMul64
val va_wpProof_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_IMul64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_IMul64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_IMul64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_IMul64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 481, "start_col": 0, "start_line": 474 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_IMul64", "Vale.X64.InsBasic.va_code_IMul64" ]
[]
false
false
false
false
false
let va_wpProof_IMul64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Avx2
val va_code_Cpuid_Avx2 : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Avx2 : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 737, "start_col": 0, "start_line": 736 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Mulx64
val va_wpProof_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Mulx64 dst_hi dst_lo src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mulx64 dst_hi dst_lo src) ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Mulx64 dst_hi dst_lo src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mulx64 dst_hi dst_lo src) ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 445, "start_col": 0, "start_line": 438 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst_hi: Vale.X64.Decls.va_operand_dst_opr64 -> dst_lo: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Mulx64", "Vale.X64.InsBasic.va_code_Mulx64" ]
[]
false
false
false
false
false
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0) ))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Xor64
val va_wpProof_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Xor64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Xor64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Xor64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Xor64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 512, "start_col": 0, "start_line": 505 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Xor64", "Vale.X64.InsBasic.va_code_Xor64" ]
[]
false
false
false
false
false
let va_wpProof_Xor64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Sse
val va_codegen_success_Cpuid_Sse : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Sse : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Sse () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 773, "start_col": 0, "start_line": 772 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Sse
val va_code_Cpuid_Sse : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Sse : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 769, "start_col": 0, "start_line": 768 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Add64Wrap
val va_lemma_Add64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Add64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_Add64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Add64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 118, "start_col": 0, "start_line": 113 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Add64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Add64Wrap" ]
[]
false
false
false
false
false
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Movbe
val va_code_Cpuid_Movbe : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Movbe : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 801, "start_col": 0, "start_line": 800 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Rdrand
val va_codegen_success_Cpuid_Rdrand : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Rdrand : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 837, "start_col": 0, "start_line": 836 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Movbe
val va_codegen_success_Cpuid_Movbe : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Movbe : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Movbe () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 805, "start_col": 0, "start_line": 804 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_And64
val va_wpProof_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_And64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_And64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_And64 dst src va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_And64 dst src) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 542, "start_col": 0, "start_line": 535 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_And64", "Vale.X64.InsBasic.va_code_And64" ]
[]
false
false
false
false
false
let va_wpProof_And64 dst src va_s0 va_k =
let va_sM, va_f0 = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Rdrand
val va_code_Cpuid_Rdrand : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Rdrand : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 833, "start_col": 0, "start_line": 832 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Shl64
val va_wpProof_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Shl64 dst amt va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shl64 dst amt) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Shl64 dst amt va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shl64 dst amt) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 572, "start_col": 0, "start_line": 565 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_shift_amt64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Shl64", "Vale.X64.InsBasic.va_code_Shl64" ]
[]
false
false
false
false
false
let va_wpProof_Shl64 dst amt va_s0 va_k =
let va_sM, va_f0 = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Avx512
val va_code_Cpuid_Avx512 : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Avx512 : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 865, "start_col": 0, "start_line": 864 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Sub64
val va_lemma_Sub64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Sub64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ 0 <= va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_Sub64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Sub64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ 0 <= va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 303, "start_col": 0, "start_line": 298 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Sub64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Sub64" ]
[]
false
false
false
false
false
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Shr64
val va_wpProof_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Shr64 dst amt va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shr64 dst amt) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Shr64 dst amt va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shr64 dst amt) ([va_Mod_flags; va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 602, "start_col": 0, "start_line": 595 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_shift_amt64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_mod_dst_opr64", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_operand_dst_opr64", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Shr64", "Vale.X64.InsBasic.va_code_Shr64" ]
[]
false
false
false
false
false
let va_wpProof_Shr64 dst amt va_s0 va_k =
let va_sM, va_f0 = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx512
val va_codegen_success_Cpuid_Avx512 : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Avx512 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 869, "start_col": 0, "start_line": 868 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Cpuid_Osxsave
val va_code_Cpuid_Osxsave : va_dummy:unit -> Tot va_code
val va_code_Cpuid_Osxsave : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 897, "start_col": 0, "start_line": 896 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Instruction_s.out", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Cpuid", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Adc64Wrap
val va_lemma_Adc64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Adc64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_Adc64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Adc64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 207, "start_col": 0, "start_line": 202 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsCf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_AddCarry64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Adc64Wrap" ]
[]
false
false
false
false
false
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Xgetbv_Avx
val va_code_Xgetbv_Avx : va_dummy:unit -> Tot va_code
val va_code_Xgetbv_Avx : va_dummy:unit -> Tot va_code
let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 38, "end_line": 929, "start_col": 0, "start_line": 928 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Machine_s.rRcx", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Xgetbv", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Cpuid_Sha
val va_wpProof_Cpuid_Sha : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Sha va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sha ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Cpuid_Sha : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Sha va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sha ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 666, "start_col": 0, "start_line": 658 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Cpuid_Sha", "Vale.X64.InsBasic.va_code_Cpuid_Sha" ]
[]
false
false
false
false
false
let va_wpProof_Cpuid_Sha va_s0 va_k =
let va_sM, va_f0 = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Cpuid_Osxsave
val va_codegen_success_Cpuid_Osxsave : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Cpuid_Osxsave : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 901, "start_col": 0, "start_line": 900 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Mul64Wrap
val va_lemma_Mul64Wrap : va_b0:va_code -> va_s0:va_state -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Mul64Wrap src) va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_mul_nat pow2_64 (va_get_reg64 rRdx va_sM) + va_get_reg64 rRax va_sM == va_mul_nat (va_get_reg64 rRax va_s0) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))))
val va_lemma_Mul64Wrap : va_b0:va_code -> va_s0:va_state -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Mul64Wrap src) va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_mul_nat pow2_64 (va_get_reg64 rRdx va_sM) + va_get_reg64 rRax va_sM == va_mul_nat (va_get_reg64 rRax va_s0) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))))
let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 403, "start_col": 0, "start_line": 397 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Prims.unit", "Vale.X64.InsBasic.lemma_fundamental_div_mod", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_eval_opr64", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRdx", "Vale.X64.Instruction_s.inOut", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.op64", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_Mul64", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Mul64Wrap" ]
[]
false
false
false
false
false
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Cpuid_AES
val va_wpProof_Cpuid_AES : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_AES va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_AES ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Cpuid_AES : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_AES va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_AES ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 634, "start_col": 0, "start_line": 626 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Cpuid_AES", "Vale.X64.InsBasic.va_code_Cpuid_AES" ]
[]
false
false
false
false
false
let va_wpProof_Cpuid_AES va_s0 va_k =
let va_sM, va_f0 = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Xgetbv_Avx
val va_codegen_success_Xgetbv_Avx : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Xgetbv_Avx : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Xgetbv_Avx () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 933, "start_col": 0, "start_line": 932 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Xgetbv_Avx512
val va_code_Xgetbv_Avx512 : va_dummy:unit -> Tot va_code
val va_code_Xgetbv_Avx512 : va_dummy:unit -> Tot va_code
let va_code_Xgetbv_Avx512 () = (mk_ins (make_instr (I.ins_Xgetbv)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 38, "end_line": 960, "start_col": 0, "start_line": 959 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx512
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.out", "Vale.X64.Instruction_s.one64Reg", "Vale.X64.Machine_s.rRax", "Vale.X64.Machine_s.rRdx", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Machine_s.rRcx", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Xgetbv", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Cpuid_Adx_Bmi2
val va_wpProof_Cpuid_Adx_Bmi2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Adx_Bmi2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Adx_Bmi2 ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Cpuid_Adx_Bmi2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Adx_Bmi2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Adx_Bmi2 ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 698, "start_col": 0, "start_line": 690 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Cpuid_Adx_Bmi2", "Vale.X64.InsBasic.va_code_Cpuid_Adx_Bmi2" ]
[]
false
false
false
false
false
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let va_sM, va_f0 = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Xgetbv_Avx512
val va_codegen_success_Xgetbv_Avx512 : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Xgetbv_Avx512 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Xgetbv_Avx512 () = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 964, "start_col": 0, "start_line": 963 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx512 [@ "opaque_to_smt"] let va_code_Xgetbv_Avx512 () = (mk_ins (make_instr (I.ins_Xgetbv)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_IMul64
val va_lemma_IMul64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_IMul64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_mul_nat (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) < pow2_64)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_mul_nat (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_IMul64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_IMul64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_mul_nat (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) < pow2_64)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == va_mul_nat (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 470, "start_col": 0, "start_line": 463 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Prims.unit", "Vale.X64.Decls.lemma_mul_in_bounds", "Vale.X64.Decls.va_eval_dst_opr64", "Vale.X64.Decls.va_eval_opr64", "Vale.X64.Decls.lemma_mul_nat", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.HavocFlags", "Vale.X64.Instructions_s.ins_IMul64", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_IMul64" ]
[]
false
false
false
false
false
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Nat64Equal
val va_codegen_success_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot va_pbool
val va_codegen_success_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot va_pbool
let va_codegen_success_Nat64Equal dst src = (va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue ()))))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 10, "end_line": 1002, "start_col": 0, "start_line": 997 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx512 [@ "opaque_to_smt"] let va_code_Xgetbv_Avx512 () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Nat64Equal [@ "opaque_to_smt"] let va_code_Nat64Equal dst src = (va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CNil ())))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_reg_opr64 -> src: Vale.X64.Decls.va_operand_reg_opr64 -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_reg_opr64", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Sub64Wrap", "Vale.X64.Decls.va_coerce_reg_opr64_to_dst_opr64", "Vale.X64.Decls.va_const_opr64", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.InsBasic.va_codegen_success_Adc64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue ()))))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Comment
val va_code_Comment : c:string -> Tot va_code
val va_code_Comment : c:string -> Tot va_code
let va_code_Comment c = (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 72, "end_line": 1040, "start_col": 0, "start_line": 1039 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx512 [@ "opaque_to_smt"] let va_code_Xgetbv_Avx512 () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Nat64Equal [@ "opaque_to_smt"] let va_code_Nat64Equal dst src = (va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CNil ()))))) [@ "opaque_to_smt"] let va_codegen_success_Nat64Equal dst src = (va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue ())))) [@"opaque_to_smt"] let va_lemma_Nat64Equal va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615) in let va_b2 = va_tl va_b1 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0) in let va_b3 = va_tl va_b2 in let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Nat64Equal dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64 src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Comment
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
c: Prims.string -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.string", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr_annotate", "Prims.Nil", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Comment", "Vale.X64.Machine_Semantics_s.AnnotateComment", "Vale.X64.Instruction_s.InstrTypeRecord", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_lemma_Adox64Wrap
val va_lemma_Adox64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Adox64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.overflow (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_of (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.overflow (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ Vale.X64.Decls.maintained_cf (va_get_flags va_sM) (va_get_flags va_s0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
val va_lemma_Adox64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Adox64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of (va_get_flags va_s0))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.overflow (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_of (va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.overflow (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ Vale.X64.Decls.maintained_cf (va_get_flags va_sM) (va_get_flags va_s0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 273, "start_col": 0, "start_line": 268 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Decls.va_operand_dst_opr64", "Vale.X64.Decls.va_operand_opr64", "Vale.X64.State.vale_state", "Vale.X64.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Prims.nat", "Vale.X64.Decls.va_eval_ins", "Vale.X64.Taint_Semantics.mk_ins", "Vale.X64.InsLemmas.make_instr", "Prims.Cons", "Vale.X64.Instruction_s.instr_out", "Vale.X64.Instruction_s.inOut", "Vale.X64.Instruction_s.opFlagsOf", "Vale.X64.Instruction_s.op64", "Prims.Nil", "Vale.X64.Instruction_s.instr_operand", "Vale.X64.Instruction_s.PreserveFlags", "Vale.X64.Instructions_s.ins_Adox64", "Prims.unit", "Vale.X64.Decls.va_ins_lemma", "Vale.X64.Decls.va_reveal_opaque", "Vale.X64.InsBasic.va_code_Adox64Wrap" ]
[]
false
false
false
false
false
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let va_old_s:va_state = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Cpuid_Avx
val va_wpProof_Cpuid_Avx : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Cpuid_Avx : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 730, "start_col": 0, "start_line": 722 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Cpuid_Avx", "Vale.X64.InsBasic.va_code_Cpuid_Avx" ]
[]
false
false
false
false
false
let va_wpProof_Cpuid_Avx va_s0 va_k =
let va_sM, va_f0 = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Hacl.Streaming.Functor.fst
Hacl.Streaming.Functor.update_empty_or_full_buf
val update_empty_or_full_buf: #index:Type0 -> c:block index -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer Lib.IntTypes.uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ (rest c i (total_len_h c i h0 s) = 0ul \/ rest c i (total_len_h c i h0 s) = c.blocks_state_len i) /\ U32.v len > 0) (ensures fun h0 s' h1 -> update_post c i s data len h0 h1))
val update_empty_or_full_buf: #index:Type0 -> c:block index -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer Lib.IntTypes.uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ (rest c i (total_len_h c i h0 s) = 0ul \/ rest c i (total_len_h c i h0 s) = c.blocks_state_len i) /\ U32.v len > 0) (ensures fun h0 s' h1 -> update_post c i s data len h0 h1))
let update_empty_or_full_buf #index c i t t' p data len = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in [@inline_let] let _ = c.update_multi_associative i in let open LowStar.BufferOps in let s = !*p in let State block_state buf total_len seen k' = s in [@inline_let] let block_state: c.state.s i = block_state in let sz = rest c i total_len in let h0 = ST.get () in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert(0 % U32.v (c.block_len i) = 0); let init_key : Ghost.erased _ = optional_reveal h0 (k' <: optional_key i c.km c.key) in let init_state : Ghost.erased _ = c.init_s i init_key in assert( let all_seen = all_seen c i h0 p in let blocks, rest = split_at_last c i all_seen in Seq.length rest = U32.v sz /\ c.state.v i h0 block_state == c.update_multi_s i init_state 0 blocks); (* Start by "flushing" the buffer: hash it so that all the data seen so far * has been processed and we can consider the buffer as empty *) if U32.(sz =^ 0ul) then begin assert( let all_seen = all_seen c i h0 p in c.state.v i h0 block_state == c.update_multi_s i init_state 0 all_seen) end else begin let prevlen = U64.(total_len `sub` FStar.Int.Cast.uint32_to_uint64 sz) in c.update_multi (G.hide i) block_state prevlen buf (c.blocks_state_len i); begin let h1 = ST.get () in let all_seen = all_seen c i h0 p in let blocks, rest = split_at_last c i all_seen in assert(Seq.length blocks = U64.v prevlen); assert(c.state.v i h0 block_state == c.update_multi_s i init_state 0 blocks); assert(c.state.v i h1 block_state == c.update_multi_s i (c.update_multi_s i init_state 0 blocks) (U64.v prevlen) rest); assert(all_seen `Seq.equal` Seq.append blocks rest); (* TODO: the pattern of ``update_multi_associative`` is not triggered *) c.update_multi_associative i init_state 0 (U64.v prevlen) blocks rest; assert(c.state.v i h1 block_state == c.update_multi_s i init_state 0 all_seen) end end; let h1 = ST.get () in assert( let all_seen = all_seen c i h0 p in c.state.v i h1 block_state == c.update_multi_s i init_state 0 all_seen); split_at_last_blocks c i (all_seen c i h0 p) (B.as_seq h0 data); // TODO: remove? let n_blocks = nblocks c i len in (**) split_at_last_num_blocks_lem c i (U32.v len); (**) assert(U32.(FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n)); let data1_len = n_blocks `U32.mul` c.blocks_state_len i in let data2_len = len `U32.sub` data1_len in let data1 = B.sub data 0ul data1_len in let data2 = B.sub data data1_len data2_len in c.update_multi (G.hide i) block_state total_len data1 data1_len; let h01 = ST.get () in optional_frame #_ #i #c.km #c.key (c.state.footprint h0 block_state) k' h0 h01; assert(preserves_freeable c i p h0 h01); begin let all_seen = all_seen c i h0 p in let data1_v = B.as_seq h01 data1 in c.update_multi_associative i init_state 0 (Seq.length all_seen) all_seen data1_v; assert(c.state.v i h01 block_state == c.update_multi_s i init_state 0 (Seq.append all_seen data1_v)) end; let dst = B.sub buf 0ul data2_len in let h1 = ST.get () in B.blit data2 0ul dst 0ul data2_len; let h2 = ST.get () in c.state.frame_invariant (B.loc_buffer buf) block_state h1 h2; optional_frame #_ #i #c.km #c.key (B.loc_buffer buf) k' h1 h2; stateful_frame_preserves_freeable #index #(Block?.state c) #i (B.loc_buffer dst) (State?.block_state s) h1 h2; assert(preserves_freeable c i p h01 h2); [@inline_let] let total_len' = add_len c i total_len len in [@inline_let] let tmp: state_s c i t t' = State #index #c #i block_state buf total_len' (seen `S.append` B.as_seq h0 data) k' in p *= tmp; let h3 = ST.get () in c.state.frame_invariant (B.loc_buffer p) block_state h2 h3; optional_frame #_ #i #c.km #c.key (B.loc_buffer p) k' h2 h3; stateful_frame_preserves_freeable #index #(Block?.state c) #i (B.loc_buffer p) (State?.block_state s) h2 h3; assert(preserves_freeable c i p h2 h3); assert(preserves_freeable c i p h0 h3); update_empty_or_full_functional_correctness #index c i t t' p data len h0 h3; (* The following proof obligation is the difficult one - keep it here for * easy debugging when updating the definitions/proofs *) assert(invariant_s c i h3 (B.get h3 p 0))
{ "file_name": "code/streaming/Hacl.Streaming.Functor.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 43, "end_line": 1436, "start_col": 0, "start_line": 1326 }
module Hacl.Streaming.Functor /// Provided an instance of the type class, this creates a streaming API on top. /// This means that every function in this module takes two extra arguments /// compared to the previous streaming module specialized for hashes: the type /// of the index, and a type class for that index. Then, as usual, a given value /// for the index as a parameter. #set-options "--max_fuel 0 --max_ifuel 0 \ --using_facts_from '*,-LowStar.Monotonic.Buffer.unused_in_not_unused_in_disjoint_2' --z3rlimit 50" module ST = FStar.HyperStack.ST module HS = FStar.HyperStack module B = LowStar.Buffer module G = FStar.Ghost module S = FStar.Seq module U32 = FStar.UInt32 module U64 = FStar.UInt64 open Hacl.Streaming.Interface open FStar.HyperStack.ST open LowStar.BufferOps open FStar.Mul open Hacl.Streaming.Spec /// State machinery /// =============== /// Little bit of trickery here to make sure state_s is parameterized over /// something at Type0, not Type0 -> Type0 -- otherwise it wouldn't monomorphize /// in KaRaMeL. noeq type state_s #index (c: block index) (i: index) (t: Type0 { t == c.state.s i }) (t': Type0 { t' == optional_key i c.km c.key }) = | State: block_state: t -> buf: B.buffer Lib.IntTypes.uint8 { B.len buf = c.blocks_state_len i } -> total_len: UInt64.t -> seen: G.erased (S.seq uint8) -> // Stupid name conflict on overloaded projectors leads to inscrutable // interleaving errors. Need a field name that does not conflict with the // one in Hacl.Streaming.Interface. Sigh!! p_key: t' -> state_s #index c i t t' /// Defining a series of helpers to deal with the indexed type of the key. This /// makes proofs easier. let optional_freeable #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> True | Runtime -> key.freeable #i h k let optional_invariant #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> True | Runtime -> key.invariant #i h k let optional_footprint #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> B.loc_none | Runtime -> key.footprint #i h k let optional_reveal #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: optional_key i km key) = allow_inversion key_management; match km with | Erased -> G.reveal k | Runtime -> key.v i h k let optional_hide #index (#i: index) (#km: key_management) (#key: stateful index) (h: HS.mem) (k: key.s i): optional_key i km key = allow_inversion key_management; match km with | Erased -> G.hide (key.v i h k) | Runtime -> k /// This lemma is used to convert the Hacl.Streaming.Interface.stateful.frame_freeable /// lemma, written with freeable in its precondition, into a lemma of the form: /// [> freeable h0 s => freeable h1 s val stateful_frame_preserves_freeable: #index:Type0 -> #sc:stateful index -> #i:index -> l:B.loc -> s:sc.s i -> h0:HS.mem -> h1:HS.mem -> Lemma (requires ( sc.invariant h0 s /\ B.loc_disjoint l (sc.footprint h0 s) /\ B.modifies l h0 h1)) (ensures ( sc.freeable h0 s ==> sc.freeable h1 s)) let stateful_frame_preserves_freeable #index #sc #i l s h0 h1 = let lem h0 h1 : Lemma (requires ( sc.invariant h0 s /\ B.loc_disjoint l (sc.footprint h0 s) /\ B.modifies l h0 h1 /\ sc.freeable h0 s)) (ensures ( sc.freeable h1 s)) [SMTPat (sc.freeable h0 s); SMTPat (sc.freeable h1 s)] = sc.frame_freeable l s h0 h1 in () let optional_frame #index (#i: index) (#km: key_management) (#key: stateful index) (l: B.loc) (s: optional_key i km key) (h0 h1: HS.mem): Lemma (requires ( optional_invariant h0 s /\ B.loc_disjoint l (optional_footprint h0 s) /\ B.modifies l h0 h1)) (ensures ( optional_invariant h1 s /\ optional_reveal h0 s == optional_reveal h1 s /\ optional_footprint h1 s == optional_footprint h0 s /\ (optional_freeable h0 s ==> optional_freeable h1 s))) = allow_inversion key_management; match km with | Erased -> () | Runtime -> key.frame_invariant #i l s h0 h1; stateful_frame_preserves_freeable #index #key #i l s h0 h1 let footprint_s #index (c: block index) (i: index) (h: HS.mem) s = let State block_state buf_ _ _ p_key = s in B.(loc_addr_of_buffer buf_ `loc_union` c.state.footprint h block_state `loc_union` optional_footprint h p_key) /// Invariants /// ========== #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let invariant_s #index (c: block index) (i: index) h s = let State block_state buf_ total_len seen key = s in let seen = G.reveal seen in let key_v = optional_reveal h key in let all_seen = S.append (c.init_input_s i key_v) seen in let blocks, rest = split_at_last c i all_seen in (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.block_len c i)); (**) assert(0 % U32.v (Block?.block_len c i) = 0); (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.blocks_state_len c i)); (**) assert(0 % U32.v (Block?.blocks_state_len c i) = 0); // Liveness and disjointness (administrative) B.live h buf_ /\ c.state.invariant #i h block_state /\ optional_invariant h key /\ B.(loc_disjoint (loc_buffer buf_) (c.state.footprint h block_state)) /\ B.(loc_disjoint (loc_buffer buf_) (optional_footprint h key)) /\ B.(loc_disjoint (optional_footprint h key) (c.state.footprint h block_state)) /\ // Formerly, the "hashes" predicate S.length blocks + S.length rest = U64.v total_len /\ U32.v (c.init_input_len i) + S.length seen = U64.v total_len /\ U64.v total_len <= U64.v (c.max_input_len i) /\ // Note the double equals here, we now no longer know that this is a sequence. c.state.v i h block_state == c.update_multi_s i (c.init_s i key_v) 0 blocks /\ S.equal (S.slice (B.as_seq h buf_) 0 (Seq.length rest)) rest #pop-options inline_for_extraction noextract let freeable_s (#index: Type0) (c: block index) (i: index) (h: HS.mem) (s: state_s' c i): Type0 = let State block_state buf_ total_len seen key = s in B.freeable buf_ /\ c.state.freeable h block_state /\ optional_freeable h key let freeable (#index : Type0) (c: block index) (i: index) (h: HS.mem) (s: state' c i) = freeable_s c i h (B.get h s 0) /\ B.freeable s #push-options "--max_ifuel 1" let invariant_loc_in_footprint #index c i s m = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in () #pop-options let seen #index c i h s = G.reveal (State?.seen (B.deref h s)) let seen_bounded #index c i h s = () let reveal_key #index c i h s = optional_reveal h (State?.p_key (B.deref h s)) let init_input (#index:Type0) (c:block index) (i:index) (h:HS.mem) (s:state' c i) : GTot bytes = c.init_input_s i (reveal_key c i h s) let all_seen (#index:Type0) (c:block index) (i:index) (h:HS.mem) (s:state' c i) : GTot bytes = S.append (init_input c i h s) (seen c i h s) let frame_invariant #index c i l s h0 h1 = let state_t = B.deref h0 s in let State block_state _ _ _ p_key = state_t in c.state.frame_invariant #i l block_state h0 h1; stateful_frame_preserves_freeable #index #c.state #i l block_state h0 h1; allow_inversion key_management; match c.km with | Erased -> () | Runtime -> stateful_frame_preserves_freeable #index #c.key #i l p_key h0 h1; c.key.frame_invariant #i l p_key h0 h1 let frame_seen #_ _ _ _ _ _ _ = () /// Stateful API /// ============ let index_of_state #index c i t t' s = let open LowStar.BufferOps in let State block_state _ _ _ _ = !*s in c.index_of_state i block_state let seen_length #index c i t t' s = let open LowStar.BufferOps in let State _ _ total_len _ _ = !*s in total_len (* TODO: malloc and alloca have big portions of proofs in common, so it may * be possible to factorize them, but it is not clear how *) #restart-solver #push-options "--z3rlimit 500" let malloc #index c i t t' key r = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; (**) let h0 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h0; let buf = B.malloc r (Lib.IntTypes.u8 0) (c.blocks_state_len i) in (**) let h1 = ST.get () in (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h1); (**) B.loc_unused_in_not_unused_in_disjoint h1; (**) B.(modifies_only_not_unused_in loc_none h0 h1); (**) c.key.frame_invariant B.loc_none key h0 h1; let block_state = c.state.create_in i r in (**) let h2 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h2 block_state) h0 h2); (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) c.key.frame_invariant B.loc_none key h1 h2; let k': optional_key i c.km c.key = match c.km with | Runtime -> let k' = c.key.create_in i r in (**) let h3 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h3; (**) B.(modifies_only_not_unused_in loc_none h2 h3); (**) c.key.frame_invariant B.loc_none key h2 h3; (**) c.state.frame_invariant B.loc_none block_state h2 h3; (**) c.state.frame_freeable B.loc_none block_state h2 h3; (**) assert (B.fresh_loc (c.key.footprint #i h3 k') h0 h3); (**) assert (c.key.invariant #i h3 k'); (**) assert (c.key.invariant #i h3 key); (**) assert B.(loc_disjoint (c.key.footprint #i h3 key) (c.key.footprint #i h3 k')); c.key.copy i key k'; (**) let h4 = ST.get () in (**) assert (B.fresh_loc (c.key.footprint #i h4 k') h0 h4); (**) B.loc_unused_in_not_unused_in_disjoint h4; (**) B.(modifies_only_not_unused_in loc_none h2 h4); (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant (c.key.footprint #i h3 k') key h3 h4; (**) c.state.frame_invariant (c.key.footprint #i h3 k') block_state h3 h4; (**) c.state.frame_freeable (c.key.footprint #i h3 k') block_state h3 h4; k' | Erased -> G.hide (c.key.v i h0 key) in (**) let h5 = ST.get () in (**) assert (B.fresh_loc (optional_footprint h5 k') h0 h5); (**) assert (B.fresh_loc (c.state.footprint #i h5 block_state) h0 h5); [@inline_let] let total_len = Int.Cast.uint32_to_uint64 (c.init_input_len i) in let s = State block_state buf total_len (G.hide S.empty) k' in (**) assert (B.fresh_loc (footprint_s c i h5 s) h0 h5); (**) B.loc_unused_in_not_unused_in_disjoint h5; let p = B.malloc r s 1ul in (**) let h6 = ST.get () in (**) B.(modifies_only_not_unused_in loc_none h5 h6); (**) B.(modifies_only_not_unused_in loc_none h0 h6); (**) c.key.frame_invariant B.loc_none key h5 h6; (**) c.state.frame_invariant B.loc_none block_state h5 h6; (**) optional_frame B.loc_none k' h5 h6; (**) assert (B.fresh_loc (B.loc_addr_of_buffer p) h0 h6); (**) assert (B.fresh_loc (footprint_s c i h6 s) h0 h6); (**) c.state.frame_freeable B.loc_none block_state h5 h6; (**) assert (optional_reveal h5 k' == optional_reveal h6 k'); c.init (G.hide i) key buf block_state; (**) let h7 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h7 block_state) h0 h7); (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h7); (**) optional_frame (B.loc_union (c.state.footprint #i h7 block_state) (B.loc_buffer buf)) k' h6 h7; (**) c.update_multi_zero i (c.state.v i h7 block_state) 0; (**) B.modifies_only_not_unused_in B.loc_none h0 h7; (**) assert (c.state.v i h7 block_state == c.init_s i (optional_reveal h6 k')); (**) let h8 = ST.get () in (**) assert (U64.v total_len <= U64.v (c.max_input_len i)); (**) begin (**) let s = B.get h8 p 0 in (**) let key_v = reveal_key c i h8 p in (**) let init_input = c.init_input_s i key_v in (**) split_at_last_init c i init_input; (**) assert(invariant_s c i h8 s) (**) end; (**) assert (invariant c i h8 p); (**) assert (seen c i h8 p == S.empty); (**) assert B.(modifies loc_none h0 h8); (**) assert (B.fresh_loc (footprint c i h8 p) h0 h8); (**) assert B.(loc_includes (loc_region_only true r) (footprint c i h8 p)); (**) assert (ST.equal_stack_domains h1 h8); (**) assert (ST.equal_stack_domains h0 h1); p #pop-options #push-options "--z3rlimit 100" let copy #index c i t t' state r = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; // All source state is suffixed by 0. let State block_state0 buf0 total_len0 seen0 k0 = !*state in let i = c.index_of_state i block_state0 in (**) let h0 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h0; let buf = B.malloc r (Lib.IntTypes.u8 0) (c.blocks_state_len i) in B.blit buf0 0ul buf 0ul (c.blocks_state_len i); (**) let h1 = ST.get () in (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h1); (**) B.loc_unused_in_not_unused_in_disjoint h1; (**) B.(modifies_only_not_unused_in loc_none h0 h1); (**) if c.km = Runtime then (**) c.key.frame_invariant #i B.loc_none k0 h0 h1; (**) c.state.frame_invariant #i B.loc_none block_state0 h0 h1; (**) assert (invariant c i h1 state); let block_state = c.state.create_in i r in (**) let h2 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h2 block_state) h0 h2); (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) if c.km = Runtime then (**) c.key.frame_invariant #i B.loc_none k0 h1 h2; (**) c.state.frame_invariant #i B.loc_none block_state0 h0 h1; (**) assert (invariant c i h2 state); c.state.copy (G.hide i) block_state0 block_state; (**) let h2 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) if c.km = Runtime then (**) c.key.frame_invariant #i (c.state.footprint #i h2 block_state) k0 h1 h2; let k': optional_key i c.km c.key = match c.km with | Runtime -> let k' = c.key.create_in i r in (**) let h3 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h3; (**) B.(modifies_only_not_unused_in loc_none h2 h3); (**) c.key.frame_invariant #i B.loc_none k0 h2 h3; (**) c.state.frame_invariant #i B.loc_none block_state h2 h3; (**) c.state.frame_freeable #i B.loc_none block_state h2 h3; (**) assert (B.fresh_loc (c.key.footprint #i h3 k') h0 h3); (**) assert (c.key.invariant #i h3 k'); (**) assert (c.key.invariant #i h3 k0); (**) assert B.(loc_disjoint (c.key.footprint #i h3 k0) (c.key.footprint #i h3 k')); c.key.copy i k0 k'; (**) let h4 = ST.get () in (**) assert (B.fresh_loc (c.key.footprint #i h4 k') h0 h4); (**) B.loc_unused_in_not_unused_in_disjoint h4; (**) B.(modifies_only_not_unused_in loc_none h2 h4); (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant #i (c.key.footprint #i h3 k') k0 h3 h4; (**) c.state.frame_invariant #i (c.key.footprint #i h3 k') block_state h3 h4; (**) c.state.frame_freeable #i (c.key.footprint #i h3 k') block_state h3 h4; k' | Erased -> k0 in (**) let h5 = ST.get () in (**) assert (B.fresh_loc (optional_footprint h5 k') h0 h5); (**) assert (B.fresh_loc (c.state.footprint #i h5 block_state) h0 h5); let s = State block_state buf total_len0 seen0 k' in (**) assert (B.fresh_loc (footprint_s c i h5 s) h0 h5); (**) B.loc_unused_in_not_unused_in_disjoint h5; let p = B.malloc r s 1ul in (**) let h6 = ST.get () in (**) B.(modifies_only_not_unused_in loc_none h5 h6); (**) B.(modifies_only_not_unused_in loc_none h0 h6); (**) if c.km = Runtime then (**) c.key.frame_invariant #i B.loc_none k0 h5 h6; (**) c.state.frame_invariant #i B.loc_none block_state h5 h6; (**) optional_frame B.loc_none k' h5 h6; (**) assert (B.fresh_loc (B.loc_addr_of_buffer p) h0 h6); (**) assert (B.fresh_loc (footprint_s c i h6 s) h0 h6); (**) c.state.frame_freeable B.loc_none block_state h5 h6; (**) assert (optional_reveal h5 k' == optional_reveal h6 k'); p #pop-options #push-options "--z3rlimit 200" let alloca #index c i t t' k = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; (**) let h0 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h0; let buf = B.alloca (Lib.IntTypes.u8 0) (c.blocks_state_len i) in (**) let h1 = ST.get () in (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h1); (**) B.loc_unused_in_not_unused_in_disjoint h1; (**) B.(modifies_only_not_unused_in loc_none h0 h1); (**) c.key.frame_invariant B.loc_none k h0 h1; let block_state = c.state.alloca i in (**) let h2 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h2 block_state) h0 h2); (**) B.loc_unused_in_not_unused_in_disjoint h2; (**) B.(modifies_only_not_unused_in loc_none h1 h2); (**) c.key.frame_invariant B.loc_none k h1 h2; let k': optional_key i c.km c.key = match c.km with | Runtime -> let k' = c.key.alloca i in (**) let h3 = ST.get () in (**) B.loc_unused_in_not_unused_in_disjoint h3; (**) B.(modifies_only_not_unused_in loc_none h2 h3); (**) c.key.frame_invariant B.loc_none k h2 h3; (**) c.state.frame_invariant B.loc_none block_state h2 h3; (**) assert (B.fresh_loc (c.key.footprint #i h3 k') h0 h3); (**) assert (c.key.invariant #i h3 k'); (**) assert (c.key.invariant #i h3 k); (**) assert B.(loc_disjoint (c.key.footprint #i h3 k) (c.key.footprint #i h3 k')); c.key.copy i k k'; (**) let h4 = ST.get () in (**) assert (B.fresh_loc (c.key.footprint #i h4 k') h0 h4); (**) B.loc_unused_in_not_unused_in_disjoint h4; (**) B.(modifies_only_not_unused_in loc_none h2 h4); (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant (c.key.footprint #i h3 k') k h3 h4; (**) c.state.frame_invariant (c.key.footprint #i h3 k') block_state h3 h4; k' | Erased -> G.hide (c.key.v i h0 k) in (**) let h5 = ST.get () in (**) assert (B.fresh_loc (optional_footprint h5 k') h0 h5); (**) assert (B.fresh_loc (c.state.footprint #i h5 block_state) h0 h5); [@inline_let] let total_len = Int.Cast.uint32_to_uint64 (c.init_input_len i) in let s = State block_state buf total_len (G.hide S.empty) k' in (**) assert (B.fresh_loc (footprint_s c i h5 s) h0 h5); (**) B.loc_unused_in_not_unused_in_disjoint h5; let p = B.alloca s 1ul in (**) let h6 = ST.get () in (**) B.(modifies_only_not_unused_in loc_none h5 h6); (**) B.(modifies_only_not_unused_in loc_none h0 h6); (**) c.key.frame_invariant B.loc_none k h5 h6; (**) c.state.frame_invariant B.loc_none block_state h5 h6; (**) optional_frame B.loc_none k' h5 h6; (**) assert (B.fresh_loc (B.loc_addr_of_buffer p) h0 h6); (**) assert (B.fresh_loc (footprint_s c i h6 s) h0 h6); (**) assert (optional_reveal h5 k' == optional_reveal h6 k'); c.init (G.hide i) k buf block_state; (**) let h7 = ST.get () in (**) assert (B.fresh_loc (c.state.footprint #i h7 block_state) h0 h7); (**) assert (B.fresh_loc (B.loc_buffer buf) h0 h7); (**) optional_frame (B.loc_union (c.state.footprint #i h7 block_state) (B.loc_buffer buf)) k' h6 h7; (**) c.update_multi_zero i (c.state.v i h7 block_state) 0; (**) B.modifies_only_not_unused_in B.loc_none h0 h7; (**) assert (c.state.v i h7 block_state == c.init_s i (optional_reveal h6 k')); (**) let h8 = ST.get () in (**) assert (U64.v total_len <= U64.v (c.max_input_len i)); (**) begin (**) let key_v = reveal_key c i h8 p in (**) let init_input = c.init_input_s i key_v in (**) split_at_last_init c i init_input; (**) assert(invariant_s c i h8 s) (**) end; (**) assert (invariant c i h8 p); (**) assert (seen c i h8 p == S.empty); (**) assert B.(modifies loc_none h0 h8); (**) assert (B.fresh_loc (footprint c i h8 p) h0 h8); (**) assert B.(loc_includes (loc_region_only true (HS.get_tip h8)) (footprint c i h8 p)); (**) assert(ST.same_refs_in_non_tip_regions h0 h8); p #pop-options #push-options "--z3cliopt smt.arith.nl=false" let reset #index c i t t' state key = [@inline_let] let _ = c.state.invariant_loc_in_footprint #i in [@inline_let] let _ = c.key.invariant_loc_in_footprint #i in allow_inversion key_management; let open LowStar.BufferOps in (**) let h1 = ST.get () in let State block_state buf _ _ k' = !*state in let i = c.index_of_state i block_state in LowStar.Ignore.ignore i; // This is only used in types and proofs [@inline_let] let block_state: c.state.s i = block_state in c.init (G.hide i) key buf block_state; (**) let h2 = ST.get () in (**) optional_frame #_ #i #c.km #c.key (B.loc_union (c.state.footprint #i h1 block_state) (B.loc_buffer buf)) k' h1 h2; (**) c.key.frame_invariant (B.loc_union (c.state.footprint #i h1 block_state) (B.loc_buffer buf)) key h1 h2; (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.block_len c i)); (**) assert(0 % UInt32.v (Block?.block_len c i) = 0); (**) assert (reveal_key c i h1 state == reveal_key c i h2 state); (**) c.update_multi_zero i (c.state.v i h2 block_state) 0; let k': optional_key i c.km c.key = match c.km with | Runtime -> c.key.copy i key k'; (**) let h4 = ST.get () in (**) assert (c.key.invariant #i h4 k'); (**) c.key.frame_invariant (c.key.footprint #i h2 k') key h2 h4; (**) c.state.frame_invariant (c.key.footprint #i h2 k') block_state h2 h4; (**) stateful_frame_preserves_freeable (c.key.footprint #i h2 k') block_state h2 h4; k' | Erased -> G.hide (c.key.v i h1 key) in (**) let h2 = ST.get () in (**) assert(preserves_freeable c i state h1 h2); [@inline_let] let total_len = Int.Cast.uint32_to_uint64 (c.init_input_len i) in let tmp: state_s c i t t' = State block_state buf total_len (G.hide S.empty) k' in B.upd state 0ul tmp; (**) let h3 = ST.get () in (**) c.state.frame_invariant B.(loc_buffer state) block_state h2 h3; (**) c.key.frame_invariant B.(loc_buffer state) key h2 h3; (**) optional_frame #_ #i #c.km #c.key B.(loc_buffer state) k' h2 h3; (**) stateful_frame_preserves_freeable B.(loc_buffer state) block_state h2 h3; (**) assert(preserves_freeable c i state h2 h3); // This seems to cause insurmountable difficulties. Puzzled. ST.lemma_equal_domains_trans h1 h2 h3; // AR: 07/22: same old `Seq.equal` and `==` story (**) assert (Seq.equal (seen c i h3 state) Seq.empty); (**) assert (footprint c i h1 state == footprint c i h3 state); (**) assert (B.(modifies (footprint c i h1 state) h1 h3)); (**) assert (U64.v total_len <= U64.v (c.max_input_len i)); (**) begin (**) let key_v = reveal_key c i h3 state in (**) let all_seen_ = all_seen c i h3 state in // SH (11/22): the proof fails if we don't introduce the call to [split_at_last] (**) let blocks, rest = split_at_last c i all_seen_ in (**) let init_input = c.init_input_s i key_v in (**) split_at_last_init c i init_input; (**) assert (invariant_s c i h3 (B.get h3 state 0)) (**) end; (**) assert(preserves_freeable c i state h1 h3) #pop-options /// Some helpers to minimize modulo-reasoning /// ========================================= val split_at_last_num_blocks_lem (#index : Type0) (c: block index) (i: index) (b: nat): Lemma ( let n_blocks = split_at_last_num_blocks c i b in let blocks = n_blocks * U32.v (c.blocks_state_len i) in 0 <= blocks /\ blocks <= b) let split_at_last_num_blocks_lem #index c i b = () /// The ``rest`` function below allows computing, based ``total_len`` stored in /// the state, the length of useful data currently stored in ``buf``. /// Unsurprisingly, there's a fair amount of modulo reasoning here because of /// 64-bit-to-32-bit conversions, so we do them once and for all in a helper. #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let rest #index (c: block index) (i: index) (total_len: UInt64.t): (x:UInt32.t { let n = split_at_last_num_blocks c i (U64.v total_len) in let l = U32.v (c.blocks_state_len i) in 0 <= n * l /\ n * l <= U64.v total_len /\ U32.v x = U64.v total_len - (n * l)}) = let open FStar.Int.Cast in [@inline_let] let l = uint32_to_uint64 (c.blocks_state_len i) in [@inline_let] let r = total_len `U64.rem` l in (**) let total_len_v : Ghost.erased nat = U64.v total_len in (**) let l_v : Ghost.erased nat = U64.v l in (**) let r_v : Ghost.erased nat = U64.v r in (**) assert(Ghost.reveal r_v = total_len_v - ((total_len_v / l_v) * l_v)); (**) Math.Lemmas.euclidean_division_definition total_len_v l_v; (**) assert(Ghost.reveal r_v = total_len_v % l_v); (**) assert(r_v < l_v); if U64.(r =^ uint_to_t 0) && U64.(total_len >^ uint_to_t 0) then begin (**) split_at_last_num_blocks_lem c i (U64.v total_len); c.blocks_state_len i end else begin [@inline_let] let r' = FStar.Int.Cast.uint64_to_uint32 r in (**) FStar.Math.Lemmas.small_modulo_lemma_1 (U64.v r) (pow2 32); (**) calc (==) { (**) U32.v r'; (**) (==) { } (**) U64.v r % pow2 32; (**) (==) { FStar.Math.Lemmas.small_modulo_lemma_1 (U64.v r) (pow2 32) } (**) U64.v r; (**) (==) { FStar.Math.Lemmas.euclidean_division_definition (U64.v total_len) (U64.v (uint32_to_uint64 (c.blocks_state_len i))) } (**) U64.v total_len % U64.v (uint32_to_uint64 (c.blocks_state_len i) ); (**) (==) { } (**) U64.v total_len % U32.v (c.blocks_state_len i); (**) }; (**) assert( (**) let n = split_at_last_num_blocks c i (U64.v total_len) in (**) let l = U32.v (c.blocks_state_len i) in (**) U32.v r' = U64.v total_len - (n * l)); r' end #pop-options /// The ``nblocks`` function below allows computing, given ``total_len`` stored in /// the state, the number of blocks of data which have been processed (the remaining /// unprocessed data being left in ``buf``). #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let nblocks #index (c: block index) (i: index) (len: UInt32.t): (x:UInt32.t { let l = U32.v (c.blocks_state_len i) in U32.v x * l <= U32.v len /\ U32.v x = split_at_last_num_blocks c i (U32.v len) }) = let open FStar.Int.Cast in [@inline_let] let l = c.blocks_state_len i in [@inline_let] let r = rest c i (uint32_to_uint64 len) in (**) let len_v : Ghost.erased nat = U32.v len in (**) let l_v : Ghost.erased nat = U32.v l in (**) let r_v : Ghost.erased nat = U32.v r in (**) let n_s : Ghost.erased nat = split_at_last_num_blocks c i len_v in (**) assert(Ghost.reveal len_v = n_s * l_v + r_v); (**) Math.Lemmas.nat_times_nat_is_nat n_s l_v; (**) assert(U32.v r <= U32.v len); [@inline_let] let blocks = len `U32.sub` r in (**) let blocks_v : Ghost.erased nat = U32.v blocks in (**) assert(blocks_v % l_v = 0); [@inline_let] let n = blocks `U32.div` l in (**) let n_v : Ghost.erased nat = U32.v n in (**) assert(n_v * l_v = Ghost.reveal blocks_v); (**) split_at_last_num_blocks_spec c i len_v n_v r_v; n #pop-options /// The ``rest`` function to call on the unprocessed data length in the ``finish`` /// function. #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let rest_finish #index (c: block index) (i: index) (len: UInt32.t): (x:UInt32.t { let l = U32.v (c.block_len i) in let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem l (U32.v len)) in 0 <= n * l /\ n * l <= U32.v len /\ U32.v x = U32.v len - (n * l)}) = [@inline_let] let l = c.block_len i in [@inline_let] let r = len `U32.rem` l in (**) split_at_last_num_blocks_lem c i (U32.v len); if U32.(r =^ uint_to_t 0) && U32.(len >^ uint_to_t 0) then begin (**) begin (**) let l = U32.v (c.block_len i) in (**) let n = fst (Lib.UpdateMulti.split_at_last_lazy_nb_rem l (U32.v len)) in (**) Math.Lemmas.nat_times_nat_is_nat n l (**) end; c.block_len i end else r #pop-options /// We always add 32-bit lengths to 64-bit lengths. Having a helper for that allows /// doing modulo reasoning once and for all. inline_for_extraction noextract let add_len #index (c: block index) (i: index) (total_len: UInt64.t) (len: UInt32.t): Pure UInt64.t (requires U64.v total_len + U32.v len <= U64.v (c.max_input_len i)) (ensures fun x -> U64.v x = U64.v total_len + U32.v len /\ U64.v x <= U64.v (c.max_input_len i)) = total_len `U64.add` Int.Cast.uint32_to_uint64 len #push-options "--z3cliopt smt.arith.nl=false" inline_for_extraction noextract let add_len_small #index (c: block index) (i: index) (total_len: UInt64.t) (len: UInt32.t): Lemma (requires U32.v len <= U32.v (c.blocks_state_len i) - U32.v (rest c i total_len) /\ U64.v total_len + U32.v len <= U64.v (c.max_input_len i)) (ensures (rest c i (add_len c i total_len len) = rest c i total_len `U32.add` len)) = let total_len_v = U64.v total_len in let l = U32.v (c.blocks_state_len i) in let b = total_len_v + U32.v len in let n = split_at_last_num_blocks c i total_len_v in let r = U32.v (rest c i total_len) in assert(total_len_v = n * l + r); let r' = U32.v (rest c i total_len) + U32.v len in assert(r' <= l); assert(r' = 0 ==> b = 0); Math.Lemmas.euclidean_division_definition b l; assert(b = n * l + r'); split_at_last_num_blocks_spec c i b n r' #pop-options /// Beginning of the three sub-cases (see Hacl.Streaming.Spec) /// ========================================================== noextract let total_len_h #index (c: block index) (i: index) h (p: state' c i) = State?.total_len (B.deref h p) noextract let split_at_last_all_seen #index (c: block index) (i: index) h (p: state' c i) = let all_seen = all_seen c i h p in let blocks, rest = split_at_last c i all_seen in blocks, rest inline_for_extraction noextract val update_small: #index:Type0 -> (c: block index) -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ U32.v len <= U32.v (c.blocks_state_len i) - U32.v (rest c i (total_len_h c i h0 s))) (ensures fun h0 s' h1 -> update_post c i s data len h0 h1)) /// SH: The proof obligations for update_small have problem succeeding in command /// line mode: hence the restart-solver instruction, the crazy rlimit and the /// intermediate lemma. Interestingly (and frustratingly), the proof succeeds /// quite quickly locally on command-line with this rlimit, but fails with a lower /// one. Besides, the lemma is needed only for the CI regression. let split_at_last_rest_eq (#index : Type0) (c: block index) (i: index) (t:Type0 { t == c.state.s i }) (t':Type0 { t' == optional_key i c.km c.key }) (s: state c i t t') (h0: HS.mem) : Lemma (requires ( invariant c i h0 s)) (ensures ( let s = B.get h0 s 0 in let State block_state buf total_len seen_ k' = s in let key_v = optional_reveal #index #i #c.km #c.key h0 k' in let all_seen = S.append (c.init_input_s i key_v) seen_ in let _, r = split_at_last c i all_seen in let sz = rest c i total_len in Seq.length r == U32.v sz)) = let s = B.get h0 s 0 in let State block_state buf total_len seen_ k' = s in let key_v = optional_reveal #index #i #c.km #c.key h0 k' in let all_seen = S.append (c.init_input_s i key_v) seen_ in let _, r = split_at_last c i all_seen in let sz = rest c i total_len in () /// Particularly difficult proof. Z3 profiling indicates that a pattern goes off /// the rails. So I disabled all of the known "bad" patterns, then did the proof /// by hand. Fortunately, there were only two stateful operations. The idea was /// to do all ofthe modifies-reasoning in the two lemmas above, then disable the /// bad pattern for the main function. /// /// This style is a little tedious, because it requires a little bit of digging /// to understand what needs to hold in order to be able to prove that e.g. the /// sequence remains unmodified from h0 to h2, but this seems more robust? val modifies_footprint: #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in s:state' c i -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( let State _ buf_ _ _ _ = B.deref h0 s in ( update_pre c i s data len h0 /\ B.(modifies (loc_buffer buf_) h0 h1)))) (ensures ( let State bs0 buf0 _ _ k0 = B.deref h0 s in let State bs1 buf1 _ _ k1 = B.deref h1 s in ( footprint c i h0 s == footprint c i h1 s /\ preserves_freeable c i s h0 h1 /\ bs0 == bs1 /\ buf0 == buf1 /\ k0 == k1 /\ c.state.invariant h1 bs1 /\ c.state.v i h1 bs1 == c.state.v i h0 bs0 /\ c.state.footprint h1 bs1 == c.state.footprint h0 bs0 /\ B.(loc_disjoint (loc_addr_of_buffer s) (loc_buffer buf1)) /\ B.(loc_disjoint (loc_addr_of_buffer s) (loc_buffer data)) /\ B.(loc_disjoint (loc_addr_of_buffer s) (loc_addr_of_buffer buf1)) /\ B.(loc_disjoint (loc_addr_of_buffer s) (c.state.footprint h1 bs1)) /\ B.(loc_disjoint (loc_buffer s) (loc_buffer buf1)) /\ B.(loc_disjoint (loc_buffer s) (loc_buffer data)) /\ B.(loc_disjoint (loc_buffer s) (c.state.footprint h1 bs1)) /\ (if c.km = Runtime then c.key.invariant #i h1 k1 /\ c.key.v i h1 k1 == c.key.v i h0 k0 /\ c.key.footprint #i h1 k1 == c.key.footprint #i h0 k0 /\ B.(loc_disjoint (loc_addr_of_buffer s) (c.key.footprint #i h1 k1)) /\ B.(loc_disjoint (loc_buffer s) (c.key.footprint #i h1 k1)) else B.(loc_disjoint (loc_addr_of_buffer s) loc_none) /\ True))))) let modifies_footprint c i p data len h0 h1 = let _ = c.state.frame_freeable #i in let _ = c.key.frame_freeable #i in let s0 = B.deref h0 p in let s1 = B.deref h0 p in let State bs0 buf0 _ _ k0 = s0 in let State bs1 buf0 _ _ k1 = s1 in c.state.frame_invariant (B.loc_buffer buf0) bs0 h0 h1; if c.km = Runtime then c.key.frame_invariant #i (B.loc_buffer buf0) k0 h0 h1 val modifies_footprint': #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in p:state' c i -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( let State bs0 buf0 _ _ k0 = B.deref h0 p in let State bs1 buf1 _ _ k1 = B.deref h1 p in ( B.live h0 p /\ B.(loc_disjoint (loc_addr_of_buffer p) (c.state.footprint #i h0 bs0)) /\ B.(loc_disjoint (loc_addr_of_buffer p) (loc_addr_of_buffer buf0)) /\ c.state.invariant h0 bs0 /\ (if c.km = Runtime then B.(loc_disjoint (loc_addr_of_buffer p) (c.key.footprint #i h0 k0)) /\ c.key.invariant #i h0 k0 else B.(loc_disjoint (loc_addr_of_buffer p) loc_none)) /\ B.(modifies (loc_buffer p) h0 h1)) /\ bs0 == bs1 /\ buf0 == buf1 /\ k0 == k1)) (ensures ( let State bs0 buf0 _ _ k0 = B.deref h0 p in let State bs1 buf1 _ _ k1 = B.deref h1 p in ( B.live h1 p /\ footprint c i h0 p == footprint c i h1 p /\ preserves_freeable c i p h0 h1 /\ B.(loc_disjoint (loc_addr_of_buffer p) (footprint_s c i h1 (B.deref h1 p))) /\ B.(loc_disjoint (loc_addr_of_buffer p) (c.state.footprint #i h1 bs1)) /\ B.(loc_disjoint (loc_buffer p) (c.state.footprint #i h1 bs1)) /\ c.state.invariant h1 bs1 /\ c.state.v i h1 bs1 == c.state.v i h0 bs0 /\ c.state.footprint h1 bs1 == c.state.footprint h0 bs0 /\ (if c.km = Runtime then c.key.invariant #i h1 k1 /\ c.key.v i h1 k1 == c.key.v i h0 k0 /\ c.key.footprint #i h1 k1 == c.key.footprint #i h0 k0 /\ B.(loc_disjoint (loc_addr_of_buffer p) (c.key.footprint #i h1 k1)) /\ B.(loc_disjoint (loc_buffer p) (c.key.footprint #i h1 k1)) else B.(loc_disjoint (loc_addr_of_buffer p) loc_none)))))) let modifies_footprint' c i p data len h0 h1 = let _ = c.state.frame_freeable #i in let _ = c.key.frame_freeable #i in let _ = c.state.frame_invariant #i in let _ = c.key.frame_invariant #i in let _ = allow_inversion key_management in let s0 = B.deref h0 p in let s1 = B.deref h0 p in let State bs0 buf0 _ _ k0 = s0 in let State bs1 buf1 _ _ k1 = s1 in c.state.frame_invariant (B.loc_addr_of_buffer p) bs0 h0 h1; if c.km = Runtime then c.key.frame_invariant #i (B.loc_addr_of_buffer p) k0 h0 h1 /// Small helper which we use to factor out functional correctness proof obligations. /// It states that a state was correctly updated to process some data between two /// memory snapshots (the key is the same, the seen data was updated, etc.). /// /// Note that we don't specify anything about the buffer and the block_state: they /// might have been updated differently depending on the case. unfold val state_is_updated : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Type0) #push-options "--z3cliopt smt.arith.nl=false" let state_is_updated #index c i t t' p data len h0 h1 = // Functional conditions about the memory updates let s0 = B.get h0 p 0 in let s1 = B.get h1 p 0 in let State block_state0 buf0 total_len0 seen0 key0 = s0 in let State block_state1 buf1 total_len1 seen1 key1 = s1 in block_state1 == block_state0 /\ buf1 == buf0 /\ U64.v total_len1 == U64.v total_len0 + U32.v len /\ key1 == key0 /\ seen1 `S.equal` (seen0 `S.append` (B.as_seq h0 data)) /\ optional_reveal #index #i #c.km #c.key h1 key1 == optional_reveal #index #i #c.km #c.key h0 key0 #pop-options /// The functional part of the invariant unfold val invariant_s_funct : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Pure Type0 (requires update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ state_is_updated c i t t' s data len h0 h1) (ensures (fun _ -> True))) let invariant_s_funct #index c i t t' p data len h0 h1 = let blocks, rest = split_at_last_all_seen c i h1 p in let s = B.get h1 p 0 in let State block_state buf_ total_len seen key = s in let key_v = optional_reveal #index #i #c.km #c.key h0 key in let init_s = c.init_s i key_v in (**) Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); c.state.v i h1 block_state == c.update_multi_s i init_s 0 blocks /\ S.equal (S.slice (B.as_seq h1 buf_) 0 (Seq.length rest)) rest /// We isolate the functional correctness proof obligations for [update_small] val update_small_functional_correctness : #index:Type0 -> (c: block index) -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( // The precondition of [small_update] update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ U32.v len <= U32.v (c.blocks_state_len i) - U32.v (rest c i (total_len_h c i h0 s)) /\ // Generic conditions state_is_updated c i t t' s data len h0 h1 /\ // Functional conditions about the memory updates begin let s0 = B.get h0 s 0 in let s1 = B.get h1 s 0 in let State block_state0 buf0 total_len0 seen0 key0 = s0 in let State block_state1 buf1 total_len1 seen1 key1 = s1 in let sz = rest c i total_len0 in let buf = buf0 in let data_v0 = B.as_seq h0 data in let buf_beg_v0 = S.slice (B.as_seq h0 buf) 0 (U32.v sz) in let buf_part_v1 = S.slice (B.as_seq h1 buf) 0 (U32.v sz + U32.v len) in buf_part_v1 == S.append buf_beg_v0 data_v0 /\ c.state.v i h1 block_state1 == c.state.v i h0 block_state0 end )) (ensures (invariant_s_funct c i t t' s data len h0 h1))) #push-options "--z3cliopt smt.arith.nl=false" let update_small_functional_correctness #index c i t t' p data len h0 h1 = let s0 = B.get h0 p 0 in let s1 = B.get h1 p 0 in let State block_state buf total_len0 seen0 key = s0 in let seen0 = G.reveal seen0 in let i = Ghost.reveal i in let key_v0 = optional_reveal #_ #i #c.km #c.key h0 key in let init_v0 = c.init_input_s i key_v0 in let all_seen0 = S.append init_v0 seen0 in let blocks0, rest0 = split_at_last c i all_seen0 in let State block_state buf total_len1 seen1 key = s1 in let seen1 = G.reveal seen1 in let i = Ghost.reveal i in let key_v1 = optional_reveal #_ #i #c.km #c.key h1 key in assert(key_v1 == key_v0); let init_v1 = c.init_input_s i key_v1 in assert(init_v1 == init_v0); let all_seen1 = S.append init_v1 seen1 in let blocks1, rest1 = split_at_last c i all_seen1 in (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.block_len c i)); (**) assert(0 % U32.v (Block?.block_len c i) = 0); (**) Math.Lemmas.modulo_lemma 0 (U32.v (Block?.blocks_state_len c i)); (**) assert(0 % U32.v (Block?.blocks_state_len c i) = 0); let data_v0 = B.as_seq h0 data in split_at_last_small c i all_seen0 data_v0; // The first problematic condition assert(blocks1 `S.equal` blocks0); assert(c.state.v i h1 block_state == c.update_multi_s i (c.init_s i key_v1) 0 blocks1); // The second problematic condition assert(S.equal (S.slice (B.as_seq h1 buf) 0 (Seq.length rest1)) rest1) #pop-options // The absence of loc_disjoint_includes makes reasoning a little more difficult. // Notably, we lose all of the important disjointness properties between the // outer point p and the buffer within B.deref h p. These need to be // re-established by hand. Another thing that we lose without this pattern is // knowing that loc_buffer b is included within loc_addr_of_buffer b. This is // important for reasoning about the preservation of e.g. the contents of data. #restart-solver #push-options "--z3rlimit 300 --z3cliopt smt.arith.nl=false --z3refresh \ --using_facts_from '*,-LowStar.Monotonic.Buffer.unused_in_not_unused_in_disjoint_2,-FStar.Seq.Properties.slice_slice,-LowStar.Monotonic.Buffer.loc_disjoint_includes_r'" let update_small #index c i t t' p data len = let open LowStar.BufferOps in let s = !*p in let State block_state buf total_len seen_ k' = s in [@inline_let] let block_state: c.state.s i = block_state in // Functional reasoning. let sz = rest c i total_len in add_len_small c i total_len len; let h0 = ST.get () in let buf1 = B.sub buf 0ul sz in let buf2 = B.sub buf sz len in // Memory reasoning. c.state.invariant_loc_in_footprint h0 block_state; if c.km = Runtime then c.key.invariant_loc_in_footprint #i h0 k'; // key_invariant_loc_in_footprint #index c i h0 p; B.(loc_disjoint_includes_r (loc_buffer data) (footprint c i h0 p) (loc_buffer buf2)); // FIRST STATEFUL OPERATION B.blit data 0ul buf2 0ul len; // Memory reasoning. let h1 = ST.get () in modifies_footprint c i p data len h0 h1; c.state.invariant_loc_in_footprint h1 block_state; if c.km = Runtime then c.key.invariant_loc_in_footprint #i h1 k'; // Functional reasoning on data begin let buf1_v0 = B.as_seq h0 buf1 in let buf1_v1 = B.as_seq h1 buf1 in let buf2_v1 = B.as_seq h1 buf2 in let buf_beg_v0 = S.slice (B.as_seq h0 buf) 0 (U32.v sz) in let buf_part_v1 = S.slice (B.as_seq h1 buf) 0 (U32.v sz + U32.v len) in let data_v0 = B.as_seq h0 data in assert(buf1_v1 == buf1_v0); assert(buf1_v0 == buf_beg_v0); assert(buf2_v1 `S.equal` data_v0); assert(buf_part_v1 `S.equal` S.append buf_beg_v0 data_v0) end; // SECOND STATEFUL OPERATION let total_len = add_len c i total_len len in [@inline_let] let tmp: state_s c i t t' = State #index #c #i block_state buf total_len (G.hide (G.reveal seen_ `S.append` (B.as_seq h0 data))) k' in p *= tmp; // Memory reasoning. let h2 = ST.get () in modifies_footprint' c i p data len h1 h2; c.state.invariant_loc_in_footprint h2 block_state; if c.km = Runtime then c.key.invariant_loc_in_footprint #i h2 k'; ST.lemma_equal_domains_trans h0 h1 h2; // Prove the invariant update_small_functional_correctness c i t t' p data len h0 h2 #pop-options // Stupid name collisions noextract let seen_h = seen noextract let all_seen_h = all_seen /// Case 2: we have no buffered data (ie: the buffer was just initialized), or the /// internal buffer is full meaning that we can just hash it to go to the case where /// there is no buffered data. Of course, the data we append has to be non-empty, /// otherwise we might end-up with an empty internal buffer. /// Auxiliary lemma which groups the functional correctness proof obligations /// for [update_empty_or_full]. #push-options "--z3cliopt smt.arith.nl=false" val update_empty_or_full_functional_correctness : #index:Type0 -> c:block index -> i:G.erased index -> ( let i = G.reveal i in t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer Lib.IntTypes.uint8 -> len: UInt32.t -> h0: HS.mem -> h1: HS.mem -> Lemma (requires ( // Same precondition as [update_empty_or_full_buf] update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ (rest c i (total_len_h c i h0 s) = 0ul \/ rest c i (total_len_h c i h0 s) = c.blocks_state_len i) /\ U32.v len > 0 /\ // Generic additional preconditions state_is_updated c i t t' s data len h0 h1 /\ // Additional preconditions begin let s0 = B.get h0 s 0 in let s1 = B.get h1 s 0 in let State block_state0 buf0 total_len0 seen0 key0 = s0 in let State block_state1 buf1 total_len1 seen1 key1 = s1 in let seen0 = G.reveal seen0 in let seen1 = G.reveal seen1 in let block_state = block_state0 in let buf = buf0 in let n_blocks = nblocks c i len in (**) split_at_last_num_blocks_lem c i (U32.v len); (**) assert(U32.v n_blocks * U32.v (c.blocks_state_len i) <= U32.v len); (**) assert(U32.(FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n)); let data1_len = n_blocks `U32.mul` c.blocks_state_len i in let data2_len = len `U32.sub` data1_len in let data1 = B.gsub data 0ul data1_len in let data2 = B.gsub data data1_len data2_len in let all_seen0 = all_seen c i h0 s in let all_seen1 = all_seen c i h1 s in let blocks0, res0 = split_at_last c i all_seen0 in let blocks1, res1 = split_at_last c i all_seen1 in let data1_v = B.as_seq h0 data1 in let data2_v = B.as_seq h0 data2 in let key = optional_reveal #index #i #c.km #c.key h0 key0 in let init_s = c.init_s i key in let all_seen_data1 = S.append all_seen0 data1_v in (**) Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); S.length all_seen0 % U32.v (c.block_len i) = 0 /\ // TODO: should be proved automatically S.length all_seen_data1 % U32.v (c.block_len i) = 0 /\ // TODO: should be proved automatically c.state.v i h1 block_state == c.update_multi_s i init_s 0 all_seen_data1 /\ S.slice (B.as_seq h1 buf) 0 (Seq.length data2_v) `S.equal` data2_v /\ True end /\ True )) (ensures (invariant_s_funct c i t t' s data len h0 h1))) #pop-options #push-options "--z3cliopt smt.arith.nl=false" let update_empty_or_full_functional_correctness #index c i t t' p data len h0 h1 = let s = B.get h0 p 0 in let State block_state buf_ total_len seen0 key = s in let init_s = c.init_s i (optional_reveal #index #i #c.km #c.key h0 key) in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); let n_blocks = nblocks c i len in (**) split_at_last_num_blocks_lem c i (U32.v len); (**) assert(U32.(FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n)); let data1_len = n_blocks `U32.mul` c.blocks_state_len i in let data2_len = len `U32.sub` data1_len in let data1 = B.gsub data 0ul data1_len in let data2 = B.gsub data data1_len data2_len in let data_v = B.as_seq h0 data in let init_input = init_input c i h0 p in let seen1 = seen c i h1 p in let all_seen0 = all_seen c i h0 p in let all_seen1 = all_seen c i h1 p in let blocks0, rest0 = split_at_last_all_seen c i h0 p in let blocks1, rest1 = split_at_last_all_seen c i h1 p in let data_blocks, data_rest = split_at_last c i data_v in split_at_last_blocks c i all_seen0 data_v; assert(Seq.equal all_seen1 (S.append all_seen0 data_v)); assert(S.equal blocks1 (S.append all_seen0 data_blocks)); assert(S.equal data_rest rest1) #pop-options inline_for_extraction noextract val update_empty_or_full_buf: #index:Type0 -> c:block index -> i:index -> ( t:Type0 { t == c.state.s i } -> t':Type0 { t' == optional_key i c.km c.key } -> s:state c i t t' -> data: B.buffer Lib.IntTypes.uint8 -> len: UInt32.t -> Stack unit (requires fun h0 -> update_pre c i s data len h0 /\ U32.v (c.init_input_len i) + S.length (seen c i h0 s) + U32.v len <= U64.v (c.max_input_len i) /\ (rest c i (total_len_h c i h0 s) = 0ul \/ rest c i (total_len_h c i h0 s) = c.blocks_state_len i) /\ U32.v len > 0) (ensures fun h0 s' h1 -> update_post c i s data len h0 h1))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Ignore.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.UpdateMulti.fst.checked", "Lib.IntTypes.fsti.checked", "Hacl.Streaming.Types.fst.checked", "Hacl.Streaming.Spec.fst.checked", "Hacl.Streaming.Interface.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.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.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Streaming.Functor.fst" }
[ { "abbrev": false, "full_module": "Hacl.Streaming.Spec", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Streaming.Interface", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Seq", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Ghost", "short_module": "G" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Streaming.Interface", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Streaming.Interface", "short_module": "I" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Seq", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Ghost", "short_module": "G" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Streaming", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Streaming", "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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "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": [ "smt.arith.nl=false" ], "z3refresh": false, "z3rlimit": 500, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c: Hacl.Streaming.Interface.block index -> i: index -> t: Type0{t == Stateful?.s (Block?.state c) i} -> t': Type0{t' == Hacl.Streaming.Interface.optional_key i (Block?.km c) (Block?.key c)} -> s: Hacl.Streaming.Functor.state c i t t' -> data: LowStar.Buffer.buffer Lib.IntTypes.uint8 -> len: FStar.UInt32.t -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Streaming.Interface.block", "Prims.eq2", "Hacl.Streaming.Interface.__proj__Stateful__item__s", "Hacl.Streaming.Interface.__proj__Block__item__state", "Hacl.Streaming.Interface.optional_key", "Hacl.Streaming.Interface.__proj__Block__item__km", "Hacl.Streaming.Interface.__proj__Block__item__key", "Hacl.Streaming.Functor.state", "LowStar.Buffer.buffer", "Lib.IntTypes.uint8", "FStar.UInt32.t", "Prims.b2t", "Prims.op_Equality", "LowStar.Monotonic.Buffer.len", "LowStar.Buffer.trivial_preorder", "Hacl.Streaming.Interface.__proj__Block__item__blocks_state_len", "FStar.UInt64.t", "FStar.Ghost.erased", "FStar.Seq.Base.seq", "Hacl.Streaming.Spec.uint8", "Prims._assert", "Hacl.Streaming.Functor.invariant_s", "LowStar.Monotonic.Buffer.get", "Hacl.Streaming.Functor.state_s", "Prims.unit", "Hacl.Streaming.Functor.update_empty_or_full_functional_correctness", "FStar.Ghost.hide", "Hacl.Streaming.Functor.preserves_freeable", "Hacl.Streaming.Functor.stateful_frame_preserves_freeable", "LowStar.Monotonic.Buffer.loc_buffer", "Hacl.Streaming.Functor.__proj__State__item__block_state", "Hacl.Streaming.Functor.optional_frame", "Hacl.Streaming.Interface.__proj__Stateful__item__frame_invariant", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "LowStar.BufferOps.op_Star_Equals", "Hacl.Streaming.Functor.State", "FStar.Seq.Base.append", "FStar.Ghost.reveal", "LowStar.Monotonic.Buffer.as_seq", "Hacl.Streaming.Functor.add_len", "LowStar.Monotonic.Buffer.blit", "FStar.UInt32.__uint_to_t", "LowStar.Monotonic.Buffer.mbuffer", "Lib.IntTypes.int_t", "Lib.IntTypes.U8", "Lib.IntTypes.SEC", "LowStar.Buffer.sub", "Hacl.Streaming.Interface.__proj__Stateful__item__t", "Hacl.Streaming.Interface.__proj__Stateful__item__v", "Hacl.Streaming.Interface.__proj__Block__item__update_multi_s", "Hacl.Streaming.Interface.__proj__Block__item__update_multi_associative", "FStar.Seq.Base.length", "Hacl.Streaming.Functor.bytes", "Hacl.Streaming.Functor.all_seen", "Hacl.Streaming.Interface.__proj__Stateful__item__footprint", "Hacl.Streaming.Interface.__proj__Block__item__update_multi", "FStar.UInt32.sub", "FStar.UInt32.mul", "FStar.UInt.size", "FStar.Mul.op_Star", "FStar.UInt32.v", "FStar.UInt32.n", "Hacl.Streaming.Functor.split_at_last_num_blocks_lem", "Prims.l_and", "Prims.op_LessThanOrEqual", "Prims.op_Multiply", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "Hacl.Streaming.Spec.split_at_last_num_blocks", "Hacl.Streaming.Functor.nblocks", "Hacl.Streaming.Spec.split_at_last_blocks", "FStar.UInt32.op_Equals_Hat", "Prims.bool", "Hacl.Streaming.Spec.bytes", "FStar.UInt64.v", "FStar.Seq.Base.equal", "FStar.UInt64.n", "FStar.Pervasives.Native.tuple2", "Hacl.Streaming.Spec.split_at_last", "FStar.UInt64.sub", "FStar.Int.Cast.uint32_to_uint64", "Hacl.Streaming.Interface.__proj__Block__item__init_s", "Hacl.Streaming.Functor.optional_reveal", "Prims.op_Modulus", "Hacl.Streaming.Interface.__proj__Block__item__block_len", "FStar.Math.Lemmas.modulo_lemma", "Prims.op_Subtraction", "Hacl.Streaming.Functor.rest", "LowStar.BufferOps.op_Bang_Star", "FStar.Integers.int_t", "FStar.Integers.Signed", "FStar.Integers.Winfinite", "Hacl.Streaming.Interface.uint8", "Prims.op_Addition", "Hacl.Streaming.Interface.__proj__Block__item__max_input_len", "Prims.squash", "Prims.Cons", "FStar.Pervasives.pattern", "FStar.Pervasives.smt_pat", "Prims.Nil", "Hacl.Streaming.Interface.__proj__Stateful__item__invariant", "LowStar.Monotonic.Buffer.loc_in", "Hacl.Streaming.Interface.__proj__Stateful__item__invariant_loc_in_footprint" ]
[]
false
true
false
false
false
let update_empty_or_full_buf #index c i t t' p data len =
[@@ inline_let ]let _ = c.state.invariant_loc_in_footprint #i in [@@ inline_let ]let _ = c.key.invariant_loc_in_footprint #i in [@@ inline_let ]let _ = c.update_multi_associative i in let open LowStar.BufferOps in let s = !*p in let State block_state buf total_len seen k' = s in [@@ inline_let ]let block_state:c.state.s i = block_state in let sz = rest c i total_len in let h0 = ST.get () in Math.Lemmas.modulo_lemma 0 (U32.v (c.block_len i)); assert (0 % U32.v (c.block_len i) = 0); let init_key:Ghost.erased _ = optional_reveal h0 (k' <: optional_key i c.km c.key) in let init_state:Ghost.erased _ = c.init_s i init_key in assert (let all_seen = all_seen c i h0 p in let blocks, rest = split_at_last c i all_seen in Seq.length rest = U32.v sz /\ c.state.v i h0 block_state == c.update_multi_s i init_state 0 blocks); if let open U32 in sz =^ 0ul then assert (let all_seen = all_seen c i h0 p in c.state.v i h0 block_state == c.update_multi_s i init_state 0 all_seen) else (let prevlen = let open U64 in total_len `sub` (FStar.Int.Cast.uint32_to_uint64 sz) in c.update_multi (G.hide i) block_state prevlen buf (c.blocks_state_len i); let h1 = ST.get () in let all_seen = all_seen c i h0 p in let blocks, rest = split_at_last c i all_seen in assert (Seq.length blocks = U64.v prevlen); assert (c.state.v i h0 block_state == c.update_multi_s i init_state 0 blocks); assert (c.state.v i h1 block_state == c.update_multi_s i (c.update_multi_s i init_state 0 blocks) (U64.v prevlen) rest); assert (all_seen `Seq.equal` (Seq.append blocks rest)); c.update_multi_associative i init_state 0 (U64.v prevlen) blocks rest; assert (c.state.v i h1 block_state == c.update_multi_s i init_state 0 all_seen)); let h1 = ST.get () in assert (let all_seen = all_seen c i h0 p in c.state.v i h1 block_state == c.update_multi_s i init_state 0 all_seen); split_at_last_blocks c i (all_seen c i h0 p) (B.as_seq h0 data); let n_blocks = nblocks c i len in split_at_last_num_blocks_lem c i (U32.v len); assert (let open U32 in FStar.UInt.size (v n_blocks * v (c.blocks_state_len i)) n); let data1_len = n_blocks `U32.mul` (c.blocks_state_len i) in let data2_len = len `U32.sub` data1_len in let data1 = B.sub data 0ul data1_len in let data2 = B.sub data data1_len data2_len in c.update_multi (G.hide i) block_state total_len data1 data1_len; let h01 = ST.get () in optional_frame #_ #i #c.km #c.key (c.state.footprint h0 block_state) k' h0 h01; assert (preserves_freeable c i p h0 h01); (let all_seen = all_seen c i h0 p in let data1_v = B.as_seq h01 data1 in c.update_multi_associative i init_state 0 (Seq.length all_seen) all_seen data1_v; assert (c.state.v i h01 block_state == c.update_multi_s i init_state 0 (Seq.append all_seen data1_v))); let dst = B.sub buf 0ul data2_len in let h1 = ST.get () in B.blit data2 0ul dst 0ul data2_len; let h2 = ST.get () in c.state.frame_invariant (B.loc_buffer buf) block_state h1 h2; optional_frame #_ #i #c.km #c.key (B.loc_buffer buf) k' h1 h2; stateful_frame_preserves_freeable #index #(Block?.state c) #i (B.loc_buffer dst) (State?.block_state s) h1 h2; assert (preserves_freeable c i p h01 h2); [@@ inline_let ]let total_len' = add_len c i total_len len in [@@ inline_let ]let tmp:state_s c i t t' = State #index #c #i block_state buf total_len' (seen `S.append` (B.as_seq h0 data)) k' in p *= tmp; let h3 = ST.get () in c.state.frame_invariant (B.loc_buffer p) block_state h2 h3; optional_frame #_ #i #c.km #c.key (B.loc_buffer p) k' h2 h3; stateful_frame_preserves_freeable #index #(Block?.state c) #i (B.loc_buffer p) (State?.block_state s) h2 h3; assert (preserves_freeable c i p h2 h3); assert (preserves_freeable c i p h0 h3); update_empty_or_full_functional_correctness #index c i t t' p data len h0 h3; assert (invariant_s c i h3 (B.get h3 p 0))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_code_Nat64Equal
val va_code_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot va_code
val va_code_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot va_code
let va_code_Nat64Equal dst src = (va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CNil ())))))
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 40, "end_line": 994, "start_col": 0, "start_line": 990 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx512 [@ "opaque_to_smt"] let va_code_Xgetbv_Avx512 () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Nat64Equal
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
dst: Vale.X64.Decls.va_operand_reg_opr64 -> src: Vale.X64.Decls.va_operand_reg_opr64 -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Decls.va_operand_reg_opr64", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Sub64Wrap", "Vale.X64.Decls.va_coerce_reg_opr64_to_dst_opr64", "Vale.X64.Decls.va_const_opr64", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.InsBasic.va_code_Adc64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CNil ())))))
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_wpProof_Cpuid_Avx2
val va_wpProof_Cpuid_Avx2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx2 ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Cpuid_Avx2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx2 ()) ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 762, "start_col": 0, "start_line": 754 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.X64.InsBasic.va_lemma_Cpuid_Avx2", "Vale.X64.InsBasic.va_code_Cpuid_Avx2" ]
[]
false
false
false
false
false
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let va_sM, va_f0 = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.X64.InsBasic.fst
Vale.X64.InsBasic.va_codegen_success_Comment
val va_codegen_success_Comment : c:string -> Tot va_pbool
val va_codegen_success_Comment : c:string -> Tot va_pbool
let va_codegen_success_Comment c = (va_ttrue ())
{ "file_name": "obj/Vale.X64.InsBasic.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 1044, "start_col": 0, "start_line": 1043 }
module Vale.X64.InsBasic open Vale.X64 open Vale.X64.StateLemmas open Vale.X64.InsLemmas open Vale.X64.Taint_Semantics open Vale.X64.CPU_Features_s open Vale.X64.Memory open Vale.X64.Stack_i module I = Vale.X64.Instructions_s module S = Vale.X64.Machine_Semantics_s friend Vale.X64.Decls #reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20" //-- Mov64 [@ "opaque_to_smt"] let va_code_Mov64 dst src = (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mov64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mov64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mov64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cmovc64 [@ "opaque_to_smt"] let va_code_Cmovc64 dst src = (mk_ins (make_instr (I.ins_Cmovc64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Cmovc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cmovc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cmovc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64 [@ "opaque_to_smt"] let va_code_Add64 dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Add64Wrap [@ "opaque_to_smt"] let va_code_Add64Wrap dst src = (mk_ins (make_instr (I.ins_Add64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Add64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Add64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Add64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AddLea64 [@ "opaque_to_smt"] let va_code_AddLea64 dst src1 src2 = (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_AddLea64 dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64 [@ "opaque_to_smt"] let va_code_Adc64 dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adc64Wrap [@ "opaque_to_smt"] let va_code_Adc64Wrap dst src = (mk_ins (make_instr (I.ins_AddCarry64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adc64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adc64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adc64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Adcx64Wrap #push-options "--smtencoding.nl_arith_repr boxwrap" [@ "opaque_to_smt"] let va_code_Adcx64Wrap dst src = (mk_ins (make_instr (I.ins_Adcx64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adcx64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) == (va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adcx64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Adox64Wrap [@ "opaque_to_smt"] let va_code_Adox64Wrap dst src = (mk_ins (make_instr (I.ins_Adox64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Adox64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Adox64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Adox64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64 [@ "opaque_to_smt"] let va_code_Sub64 dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sub64Wrap [@ "opaque_to_smt"] let va_code_Sub64Wrap dst src = (mk_ins (make_instr (I.ins_Sub64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sub64Wrap dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sub64Wrap va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sub64Wrap dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Sbb64 [@ "opaque_to_smt"] let va_code_Sbb64 dst src = (mk_ins (make_instr (I.ins_Sbb64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Sbb64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Sbb64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Sbb64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- #restart-solver #push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'" let lemma_fundamental_div_mod (a b:nat64) : Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b) = FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64 #pop-options //-- lemma_fundamental_div_mod //-- //-- Mul64Wrap [@ "opaque_to_smt"] let va_code_Mul64Wrap src = (mk_ins (make_instr (I.ins_Mul64) src)) [@ "opaque_to_smt"] let va_codegen_success_Mul64Wrap src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mul64Wrap va_b0 va_s0 src = va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mul64Wrap src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mulx64 [@ "opaque_to_smt"] let va_code_Mulx64 dst_hi dst_lo src = (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) [@ "opaque_to_smt"] let va_codegen_success_Mulx64 dst_hi dst_lo src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src = va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)))); va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- lemma_mul_nat //-- //-- lemma_mul_in_bounds //-- //-- IMul64 [@ "opaque_to_smt"] let va_code_IMul64 dst src = (mk_ins (make_instr (I.ins_IMul64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_IMul64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_IMul64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_IMul64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xor64 [@ "opaque_to_smt"] let va_code_Xor64 dst src = (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) [@ "opaque_to_smt"] let va_codegen_success_Xor64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xor64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xor64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- And64 [@ "opaque_to_smt"] let va_code_And64 dst src = (mk_ins (make_instr (I.ins_And64) dst src)) [@ "opaque_to_smt"] let va_codegen_success_And64 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_And64 va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_And64 dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shl64 [@ "opaque_to_smt"] let va_code_Shl64 dst amt = (mk_ins (make_instr (I.ins_Shl64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shl64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shl64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shl64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Shr64 [@ "opaque_to_smt"] let va_code_Shr64 dst amt = (mk_ins (make_instr (I.ins_Shr64) dst amt)) [@ "opaque_to_smt"] let va_codegen_success_Shr64 dst amt = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Shr64 va_b0 va_s0 dst amt = va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Shr64 dst amt va_s0 va_k = let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_AES [@ "opaque_to_smt"] let va_code_Cpuid_AES () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_AES () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_AES va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_AES va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sha [@ "opaque_to_smt"] let va_code_Cpuid_Sha () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sha () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sha va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sha va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Adx_Bmi2 [@ "opaque_to_smt"] let va_code_Cpuid_Adx_Bmi2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Adx_Bmi2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx [@ "opaque_to_smt"] let va_code_Cpuid_Avx () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx2 [@ "opaque_to_smt"] let va_code_Cpuid_Avx2 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx2 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx2 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Sse [@ "opaque_to_smt"] let va_code_Cpuid_Sse () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Sse () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Sse va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Sse va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Movbe [@ "opaque_to_smt"] let va_code_Cpuid_Movbe () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Movbe () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Movbe va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Movbe va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Rdrand [@ "opaque_to_smt"] let va_code_Cpuid_Rdrand () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Rdrand () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Rdrand va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Rdrand va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Avx512 [@ "opaque_to_smt"] let va_code_Cpuid_Avx512 () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Cpuid_Osxsave [@ "opaque_to_smt"] let va_code_Cpuid_Osxsave () = (mk_ins (make_instr (I.ins_Cpuid))) [@ "opaque_to_smt"] let va_codegen_success_Cpuid_Osxsave () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Cpuid_Osxsave va_b0 va_s0 = va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in Vale.X64.CPU_Features_s.cpuid_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Cpuid_Osxsave va_s0 va_k = let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx [@ "opaque_to_smt"] let va_code_Xgetbv_Avx () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xgetbv_Avx512 [@ "opaque_to_smt"] let va_code_Xgetbv_Avx512 () = (mk_ins (make_instr (I.ins_Xgetbv))) [@ "opaque_to_smt"] let va_codegen_success_Xgetbv_Avx512 () = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xgetbv_Avx512 va_b0 va_s0 = va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ()); let (va_old_s:va_state) = va_s0 in va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0; let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in Vale.X64.CPU_Features_s.xgetbv_features (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xgetbv_Avx512 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Nat64Equal [@ "opaque_to_smt"] let va_code_Nat64Equal dst src = (va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_CNil ()))))) [@ "opaque_to_smt"] let va_codegen_success_Nat64Equal dst src = (va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue ())))) [@"opaque_to_smt"] let va_lemma_Nat64Equal va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64 18446744073709551615) in let va_b2 = va_tl va_b1 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0) in let va_b3 = va_tl va_b2 in let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Nat64Equal dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64 src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Comment [@ "opaque_to_smt"] let va_code_Comment c = (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Taint_Semantics.fst.checked", "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Instructions_s.fsti.checked", "Vale.X64.InsLemmas.fsti.checked", "Vale.X64.Decls.fst.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Math.Lemmas.fst.checked" ], "interface_file": true, "source_file": "Vale.X64.InsBasic.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "S" }, { "abbrev": true, "full_module": "Vale.X64.Instructions_s", "short_module": "I" }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Taint_Semantics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.StateLemmas", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "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.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.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 } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 5, "initial_ifuel": 0, "max_fuel": 5, "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": 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" }
false
c: Prims.string -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.string", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Comment c =
(va_ttrue ())
false