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
Effects.Def.fst
Effects.Def.monad_laws_via_eq
val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h))
val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h))
let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in ()
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 4, "end_line": 58, "start_col": 0, "start_line": 49 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
m: (_: Type -> Type) -> eq: Effects.Def.eq_m m -> return: (a: Type -> x: a -> m a) -> bind: (a: Type -> b: Type -> _: m a -> _: (_: a -> m b) -> m b) -> FStar.Pervasives.Lemma (requires (forall (a: Type) (f: m a). eq a (bind a a f (return a)) f) /\ (forall (a: Type) (b: Type) (x: a) (f: (_: a -> m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a: Type) (b: Type) (c: Type) (f: m a) (g: (_: a -> m b)) (h: (_: b -> m c)). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a: Type) (f: m a). bind a a f (return a) == f) /\ (forall (a: Type) (b: Type) (x: a) (f: (_: a -> m b)). bind a b (return a x) f == f x) /\ (forall (a: Type) (b: Type) (c: Type) (f: m a) (g: (_: a -> m b)) (h: (_: b -> m c)). bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Effects.Def.eq_m", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.eq2", "Prims.Cons", "FStar.Pervasives.pattern", "FStar.Pervasives.smt_pat", "Prims.Nil", "Prims._assert", "Effects.Def.eq_m_aux" ]
[]
false
false
true
false
false
let monad_laws_via_eq m eq return bind =
let lem (a: Type) (f: m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (eq a (bind a a f (return a)) f); eq_m_aux eq (bind a a f (return a)) f; assert (bind a a f (return a) == f) in ()
false
Effects.Def.fst
Effects.Def.exnst
val exnst : a: Type -> Type
let exnst (a:Type) = restricted_t s (fun _ -> (option (a * s)))
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 63, "end_line": 154, "start_col": 0, "start_line": 154 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1) let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn (* ******************************************************************************) (* Effect (exnst a) : A combined monad, state over exceptions *)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
a: Type -> Type
Prims.Tot
[ "total" ]
[]
[ "FStar.FunctionalExtensionality.restricted_t", "Effects.Def.s", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.tuple2" ]
[]
false
false
false
true
true
let exnst (a: Type) =
restricted_t s (fun _ -> (option (a * s)))
false
Vale.PPC64LE.InsVector.fst
Vale.PPC64LE.InsVector.va_lemma_Vcipherlast
val va_lemma_Vcipherlast : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vcipherlast dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Def.Types_s.quad32_xor (Vale.AES.AES_BE_s.shift_rows (Vale.AES.AES_common_s.sub_bytes (va_eval_vec_opr va_s0 src1))) (va_eval_vec_opr va_s0 src2) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
val va_lemma_Vcipherlast : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vcipherlast dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Def.Types_s.quad32_xor (Vale.AES.AES_BE_s.shift_rows (Vale.AES.AES_common_s.sub_bytes (va_eval_vec_opr va_s0 src1))) (va_eval_vec_opr va_s0 src2) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
let va_lemma_Vcipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipherlast) (va_code_Vcipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipherlast dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.PPC64LE.InsVector.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1131, "start_col": 0, "start_line": 1126 }
module Vale.PPC64LE.InsVector open Vale.Def.Types_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Spec.Hash.Definitions open Spec.SHA2 friend Vale.PPC64LE.Decls module S = Vale.PPC64LE.Semantics_s #reset-options "--initial_fuel 2 --max_fuel 4 --max_ifuel 2 --z3rlimit 50" //-- Vmr [@ "opaque_to_smt"] let va_code_Vmr dst src = (Ins (S.Vmr dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vmr dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmr va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vmr) (va_code_Vmr dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmr dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmr dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmr dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmr (va_code_Vmr 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrd [@ "opaque_to_smt"] let va_code_Mfvsrd dst src = (Ins (S.Mfvsrd dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrd dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrd va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrd) (va_code_Mfvsrd dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrd dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrd dst src)) va_s0 in Vale.Arch.Types.hi64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrd dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrd (va_code_Mfvsrd 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrld [@ "opaque_to_smt"] let va_code_Mfvsrld dst src = (Ins (S.Mfvsrld dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrld dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrld va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrld) (va_code_Mfvsrld dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrld dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrld dst src)) va_s0 in Vale.Arch.Types.lo64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrld dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrld (va_code_Mfvsrld 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrdd [@ "opaque_to_smt"] let va_code_Mtvsrdd dst src1 src2 = (Ins (S.Mtvsrdd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrdd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrdd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Mtvsrdd) (va_code_Mtvsrdd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrdd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrdd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrdd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrdd (va_code_Mtvsrdd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrws [@ "opaque_to_smt"] let va_code_Mtvsrws dst src = (Ins (S.Mtvsrws dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrws dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrws va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mtvsrws) (va_code_Mtvsrws dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrws dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrws dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrws dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrws (va_code_Mtvsrws 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vadduwm [@ "opaque_to_smt"] let va_code_Vadduwm dst src1 src2 = (Ins (S.Vadduwm dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vadduwm dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vadduwm va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vadduwm) (va_code_Vadduwm dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vadduwm dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vadduwm dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vadduwm dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vadduwm (va_code_Vadduwm 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vxor [@ "opaque_to_smt"] let va_code_Vxor dst src1 src2 = (Ins (S.Vxor dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vxor dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vxor va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vxor) (va_code_Vxor dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vxor dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vxor dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vxor dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vxor (va_code_Vxor 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vand [@ "opaque_to_smt"] let va_code_Vand dst src1 src2 = (Ins (S.Vand dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vand dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vand va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vand) (va_code_Vand dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vand dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vand dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vand dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vand (va_code_Vand 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vslw [@ "opaque_to_smt"] let va_code_Vslw dst src1 src2 = (Ins (S.Vslw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vslw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vslw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vslw) (va_code_Vslw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vslw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vslw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vslw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vslw (va_code_Vslw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsrw [@ "opaque_to_smt"] let va_code_Vsrw dst src1 src2 = (Ins (S.Vsrw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsrw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsrw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsrw) (va_code_Vsrw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsrw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsrw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsrw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsrw (va_code_Vsrw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsl [@ "opaque_to_smt"] let va_code_Vsl dst src1 src2 = (Ins (S.Vsl dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsl dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsl va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsl) (va_code_Vsl dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsl dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsl dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsl dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsl (va_code_Vsl 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcmpequw [@ "opaque_to_smt"] let va_code_Vcmpequw dst src1 src2 = (Ins (S.Vcmpequw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcmpequw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcmpequw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcmpequw) (va_code_Vcmpequw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcmpequw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcmpequw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcmpequw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcmpequw (va_code_Vcmpequw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsldoi [@ "opaque_to_smt"] let va_code_Vsldoi dst src1 src2 count = (Ins (S.Vsldoi dst src1 src2 count)) [@ "opaque_to_smt"] let va_codegen_success_Vsldoi dst src1 src2 count = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsldoi va_b0 va_s0 dst src1 src2 count = va_reveal_opaque (`%va_code_Vsldoi) (va_code_Vsldoi dst src1 src2 count); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsldoi dst src1 src2 count)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsldoi dst src1 src2 count)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsldoi dst src1 src2 count va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsldoi (va_code_Vsldoi dst src1 src2 count) va_s0 dst src1 src2 count in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vmrghw [@ "opaque_to_smt"] let va_code_Vmrghw dst src1 src2 = (Ins (S.Vmrghw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vmrghw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmrghw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vmrghw) (va_code_Vmrghw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmrghw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmrghw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmrghw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmrghw (va_code_Vmrghw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xxmrghd [@ "opaque_to_smt"] let va_code_Xxmrghd dst src1 src2 = (Ins (S.Xxmrghd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Xxmrghd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xxmrghd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Xxmrghd) (va_code_Xxmrghd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Xxmrghd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Xxmrghd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xxmrghd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xxmrghd (va_code_Xxmrghd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsel [@ "opaque_to_smt"] let va_code_Vsel dst src1 src2 sel = (Ins (S.Vsel dst src1 src2 sel)) [@ "opaque_to_smt"] let va_codegen_success_Vsel dst src1 src2 sel = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsel va_b0 va_s0 dst src1 src2 sel = va_reveal_opaque (`%va_code_Vsel) (va_code_Vsel dst src1 src2 sel); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsel dst src1 src2 sel)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsel dst src1 src2 sel)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsel dst src1 src2 sel va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsel (va_code_Vsel dst src1 src2 sel) va_s0 dst src1 src2 sel in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltw [@ "opaque_to_smt"] let va_code_Vspltw dst src uim = (Ins (S.Vspltw dst src uim)) [@ "opaque_to_smt"] let va_codegen_success_Vspltw dst src uim = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltw va_b0 va_s0 dst src uim = va_reveal_opaque (`%va_code_Vspltw) (va_code_Vspltw dst src uim); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltw dst src uim)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltw dst src uim)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltw dst src uim va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltw (va_code_Vspltw dst src uim) va_s0 dst src uim in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisw [@ "opaque_to_smt"] let va_code_Vspltisw dst src = (Ins (S.Vspltisw dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisw dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisw va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisw) (va_code_Vspltisw dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisw dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisw dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisw dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisw (va_code_Vspltisw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisb [@ "opaque_to_smt"] let va_code_Vspltisb dst src = (Ins (S.Vspltisb dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisb dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisb va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisb) (va_code_Vspltisb dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisb dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisb dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisb dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisb (va_code_Vspltisb 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_buffer [@ "opaque_to_smt"] let va_code_Load128_buffer h dst base offset t = (Ins (S.Load128 dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_buffer h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_buffer va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_buffer) (va_code_Load128_buffer h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128 dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128 dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_buffer h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_buffer (va_code_Load128_buffer h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_buffer [@ "opaque_to_smt"] let va_code_Store128_buffer h src base offset t = (Ins (S.Store128 src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_buffer h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_buffer va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_buffer) (va_code_Store128_buffer h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128 src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128 src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (va_eval_vec_opr va_old_s src) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_buffer h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_buffer (va_code_Store128_buffer h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer [@ "opaque_to_smt"] let va_code_Load128_word4_buffer h dst base t = (Ins (S.Load128Word4 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer) (va_code_Load128_word4_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer (va_code_Load128_word4_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Load128_word4_buffer_index h dst base offset t = (Ins (S.Load128Word4Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer_index) (va_code_Load128_word4_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer_index (va_code_Load128_word4_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer [@ "opaque_to_smt"] let va_code_Store128_word4_buffer h src base t = (Ins (S.Store128Word4 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer) (va_code_Store128_word4_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer (va_code_Store128_word4_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Store128_word4_buffer_index h src base offset t = (Ins (S.Store128Word4Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer_index) (va_code_Store128_word4_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer_index (va_code_Store128_word4_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer h dst base t = (Ins (S.Load128Byte16 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer) (va_code_Load128_byte16_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer (va_code_Load128_byte16_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer_index h dst base offset t = (Ins (S.Load128Byte16Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer_index) (va_code_Load128_byte16_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer_index (va_code_Load128_byte16_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer h src base t = (Ins (S.Store128Byte16 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer) (va_code_Store128_byte16_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer (va_code_Store128_byte16_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer_index h src base offset t = (Ins (S.Store128Byte16Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer_index) (va_code_Store128_byte16_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer_index (va_code_Store128_byte16_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma0 [@ "opaque_to_smt"] let va_code_SHA256_sigma0 dst src = (Ins (S.Vshasigmaw0 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma0 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma0) (va_code_SHA256_sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw0 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw0 dst src)) va_s0 in lemma_sha256_sigma0 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma0 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma0 (va_code_SHA256_sigma0 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma1 [@ "opaque_to_smt"] let va_code_SHA256_sigma1 dst src = (Ins (S.Vshasigmaw1 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma1 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma1) (va_code_SHA256_sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw1 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw1 dst src)) va_s0 in lemma_sha256_sigma1 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma1 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma1 (va_code_SHA256_sigma1 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma0 [@ "opaque_to_smt"] let va_code_SHA256_Sigma0 dst src = (Ins (S.Vshasigmaw2 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma0 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma0) (va_code_SHA256_Sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw2 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw2 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma2 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma0 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma0 (va_code_SHA256_Sigma0 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma1 [@ "opaque_to_smt"] let va_code_SHA256_Sigma1 dst src = (Ins (S.Vshasigmaw3 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma1 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma1) (va_code_SHA256_Sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw3 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw3 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma3 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma1 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma1 (va_code_SHA256_Sigma1 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsbox [@ "opaque_to_smt"] let va_code_Vsbox dst src = (Ins (S.Vsbox dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vsbox dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsbox va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vsbox) (va_code_Vsbox dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsbox dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsbox dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsbox dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsbox (va_code_Vsbox 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- RotWord [@ "opaque_to_smt"] let va_code_RotWord dst src1 src2 = (Ins (S.RotWord dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_RotWord dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_RotWord va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_RotWord) (va_code_RotWord dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.RotWord dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.RotWord dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_RotWord dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_RotWord (va_code_RotWord 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipher [@ "opaque_to_smt"] let va_code_Vcipher dst src1 src2 = (Ins (S.Vcipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipher (va_code_Vcipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipherlast [@ "opaque_to_smt"] let va_code_Vcipherlast dst src1 src2 = (Ins (S.Vcipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipherlast dst src1 src2 = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Semantics_s.fst.checked", "Vale.PPC64LE.Memory_Sems.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.Types.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Hash.Definitions.fst.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.InsVector.fst" }
[ { "abbrev": true, "full_module": "Vale.PPC64LE.Semantics_s", "short_module": "S" }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2.Bits_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Sel", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Two_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 4, "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> dst: Vale.PPC64LE.Decls.va_operand_vec_opr -> src1: Vale.PPC64LE.Decls.va_operand_vec_opr -> src2: Vale.PPC64LE.Decls.va_operand_vec_opr -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.State.state", "Vale.PPC64LE.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Prims.nat", "Vale.PPC64LE.Decls.va_eval_ins", "Vale.PPC64LE.Machine_s.Ins", "Vale.PPC64LE.Semantics_s.ins", "Vale.PPC64LE.Semantics_s.ocmp", "Vale.PPC64LE.Semantics_s.Vcipherlast", "Prims.unit", "Vale.PPC64LE.Decls.va_ins_lemma", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_reveal_opaque", "Vale.PPC64LE.InsVector.va_code_Vcipherlast" ]
[]
false
false
false
false
false
let va_lemma_Vcipherlast va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_Vcipherlast) (va_code_Vcipherlast dst src1 src2); let va_old_s:va_state = va_s0 in va_ins_lemma (Ins (S.Vcipherlast dst src1 src2)) va_s0; let va_sM, va_fM = va_eval_ins (Ins (S.Vcipherlast dst src1 src2)) va_s0 in (va_sM, va_fM)
false
Hacl.Bignum64.fst
Hacl.Bignum64.mod_exp_consttime_precomp
val mod_exp_consttime_precomp: len:Ghost.erased _ -> BS.bn_mod_exp_ctx_st t_limbs len
val mod_exp_consttime_precomp: len:Ghost.erased _ -> BS.bn_mod_exp_ctx_st t_limbs len
let mod_exp_consttime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_ct_precomp k a bBits b res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 70, "end_line": 73, "start_col": 0, "start_line": 71 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len) let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res let mod_exp_vartime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_vt n a bBits b res let mod_exp_consttime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res let mod_inv_prime_vartime len n a res = BS.mk_bn_mod_inv_prime_safe len (ke len).BE.exp_vt n a res let mont_ctx_init len r n = MA.bn_field_init len (ke len).BE.precompr2 r n let mont_ctx_free k = MA.bn_field_free k let mod_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.bn_mod_ctx len (bn_slow_precomp len1) k a res let mod_exp_vartime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_vt_precomp k a bBits b res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: FStar.Ghost.erased (Hacl.Bignum.meta_len Hacl.Bignum64.t_limbs) -> Hacl.Bignum.SafeAPI.bn_mod_exp_ctx_st Hacl.Bignum64.t_limbs (FStar.Ghost.reveal len)
Prims.Tot
[ "total" ]
[]
[ "FStar.Ghost.erased", "Hacl.Bignum.meta_len", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.MontArithmetic.pbn_mont_ctx", "Hacl.Bignum.Definitions.lbignum", "FStar.Ghost.reveal", "Lib.IntTypes.size_t", "Hacl.Bignum.Definitions.blocks0", "Lib.IntTypes.size", "Lib.IntTypes.bits", "Hacl.Bignum.SafeAPI.mk_bn_mod_exp_ctx", "Hacl.Bignum.Exponentiation.__proj__Mkexp__item__exp_ct_precomp", "Hacl.Bignum64.ke", "Prims.unit", "Hacl.Bignum.MontArithmetic.bn_field_get_len" ]
[]
false
false
false
false
false
let mod_exp_consttime_precomp len k a bBits b res =
let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_ct_precomp k a bBits b res
false
Hacl.Bignum64.fst
Hacl.Bignum64.sqr
val sqr: len:BN.meta_len t_limbs -> a:lbignum t_limbs len -> BN.bn_karatsuba_sqr_st t_limbs len a
val sqr: len:BN.meta_len t_limbs -> a:lbignum t_limbs len -> BN.bn_karatsuba_sqr_st t_limbs len a
let sqr len a res = (ke len).BE.bn.BN.sqr a res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 29, "end_line": 39, "start_col": 0, "start_line": 38 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: Hacl.Bignum.meta_len Hacl.Bignum64.t_limbs -> a: Hacl.Bignum64.lbignum Hacl.Bignum64.t_limbs len -> Hacl.Bignum.bn_karatsuba_sqr_st Hacl.Bignum64.t_limbs len a
Prims.Tot
[ "total" ]
[]
[ "Hacl.Bignum.meta_len", "Hacl.Bignum64.t_limbs", "Hacl.Bignum64.lbignum", "Hacl.Bignum.Definitions.lbignum", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Bignum.__proj__Mkbn__item__sqr", "Hacl.Bignum.Exponentiation.__proj__Mkexp__item__bn", "Hacl.Bignum64.ke", "Prims.unit" ]
[]
false
false
false
false
false
let sqr len a res =
(ke len).BE.bn.BN.sqr a res
false
Vale.PPC64LE.InsVector.fst
Vale.PPC64LE.InsVector.va_wpProof_Vncipherlast
val va_wpProof_Vncipherlast : dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Vncipherlast dst src1 src2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Vncipherlast dst src1 src2) ([va_mod_vec_opr dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Vncipherlast : dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Vncipherlast dst src1 src2 va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Vncipherlast dst src1 src2) ([va_mod_vec_opr dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Vncipherlast dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vncipherlast (va_code_Vncipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.PPC64LE.InsVector.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 1201, "start_col": 0, "start_line": 1194 }
module Vale.PPC64LE.InsVector open Vale.Def.Types_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Spec.Hash.Definitions open Spec.SHA2 friend Vale.PPC64LE.Decls module S = Vale.PPC64LE.Semantics_s #reset-options "--initial_fuel 2 --max_fuel 4 --max_ifuel 2 --z3rlimit 50" //-- Vmr [@ "opaque_to_smt"] let va_code_Vmr dst src = (Ins (S.Vmr dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vmr dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmr va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vmr) (va_code_Vmr dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmr dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmr dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmr dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmr (va_code_Vmr 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrd [@ "opaque_to_smt"] let va_code_Mfvsrd dst src = (Ins (S.Mfvsrd dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrd dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrd va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrd) (va_code_Mfvsrd dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrd dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrd dst src)) va_s0 in Vale.Arch.Types.hi64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrd dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrd (va_code_Mfvsrd 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrld [@ "opaque_to_smt"] let va_code_Mfvsrld dst src = (Ins (S.Mfvsrld dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrld dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrld va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrld) (va_code_Mfvsrld dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrld dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrld dst src)) va_s0 in Vale.Arch.Types.lo64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrld dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrld (va_code_Mfvsrld 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrdd [@ "opaque_to_smt"] let va_code_Mtvsrdd dst src1 src2 = (Ins (S.Mtvsrdd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrdd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrdd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Mtvsrdd) (va_code_Mtvsrdd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrdd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrdd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrdd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrdd (va_code_Mtvsrdd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrws [@ "opaque_to_smt"] let va_code_Mtvsrws dst src = (Ins (S.Mtvsrws dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrws dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrws va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mtvsrws) (va_code_Mtvsrws dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrws dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrws dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrws dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrws (va_code_Mtvsrws 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vadduwm [@ "opaque_to_smt"] let va_code_Vadduwm dst src1 src2 = (Ins (S.Vadduwm dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vadduwm dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vadduwm va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vadduwm) (va_code_Vadduwm dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vadduwm dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vadduwm dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vadduwm dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vadduwm (va_code_Vadduwm 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vxor [@ "opaque_to_smt"] let va_code_Vxor dst src1 src2 = (Ins (S.Vxor dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vxor dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vxor va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vxor) (va_code_Vxor dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vxor dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vxor dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vxor dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vxor (va_code_Vxor 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vand [@ "opaque_to_smt"] let va_code_Vand dst src1 src2 = (Ins (S.Vand dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vand dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vand va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vand) (va_code_Vand dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vand dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vand dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vand dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vand (va_code_Vand 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vslw [@ "opaque_to_smt"] let va_code_Vslw dst src1 src2 = (Ins (S.Vslw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vslw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vslw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vslw) (va_code_Vslw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vslw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vslw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vslw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vslw (va_code_Vslw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsrw [@ "opaque_to_smt"] let va_code_Vsrw dst src1 src2 = (Ins (S.Vsrw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsrw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsrw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsrw) (va_code_Vsrw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsrw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsrw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsrw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsrw (va_code_Vsrw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsl [@ "opaque_to_smt"] let va_code_Vsl dst src1 src2 = (Ins (S.Vsl dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsl dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsl va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsl) (va_code_Vsl dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsl dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsl dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsl dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsl (va_code_Vsl 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcmpequw [@ "opaque_to_smt"] let va_code_Vcmpequw dst src1 src2 = (Ins (S.Vcmpequw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcmpequw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcmpequw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcmpequw) (va_code_Vcmpequw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcmpequw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcmpequw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcmpequw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcmpequw (va_code_Vcmpequw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsldoi [@ "opaque_to_smt"] let va_code_Vsldoi dst src1 src2 count = (Ins (S.Vsldoi dst src1 src2 count)) [@ "opaque_to_smt"] let va_codegen_success_Vsldoi dst src1 src2 count = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsldoi va_b0 va_s0 dst src1 src2 count = va_reveal_opaque (`%va_code_Vsldoi) (va_code_Vsldoi dst src1 src2 count); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsldoi dst src1 src2 count)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsldoi dst src1 src2 count)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsldoi dst src1 src2 count va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsldoi (va_code_Vsldoi dst src1 src2 count) va_s0 dst src1 src2 count in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vmrghw [@ "opaque_to_smt"] let va_code_Vmrghw dst src1 src2 = (Ins (S.Vmrghw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vmrghw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmrghw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vmrghw) (va_code_Vmrghw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmrghw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmrghw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmrghw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmrghw (va_code_Vmrghw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xxmrghd [@ "opaque_to_smt"] let va_code_Xxmrghd dst src1 src2 = (Ins (S.Xxmrghd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Xxmrghd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xxmrghd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Xxmrghd) (va_code_Xxmrghd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Xxmrghd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Xxmrghd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xxmrghd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xxmrghd (va_code_Xxmrghd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsel [@ "opaque_to_smt"] let va_code_Vsel dst src1 src2 sel = (Ins (S.Vsel dst src1 src2 sel)) [@ "opaque_to_smt"] let va_codegen_success_Vsel dst src1 src2 sel = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsel va_b0 va_s0 dst src1 src2 sel = va_reveal_opaque (`%va_code_Vsel) (va_code_Vsel dst src1 src2 sel); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsel dst src1 src2 sel)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsel dst src1 src2 sel)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsel dst src1 src2 sel va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsel (va_code_Vsel dst src1 src2 sel) va_s0 dst src1 src2 sel in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltw [@ "opaque_to_smt"] let va_code_Vspltw dst src uim = (Ins (S.Vspltw dst src uim)) [@ "opaque_to_smt"] let va_codegen_success_Vspltw dst src uim = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltw va_b0 va_s0 dst src uim = va_reveal_opaque (`%va_code_Vspltw) (va_code_Vspltw dst src uim); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltw dst src uim)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltw dst src uim)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltw dst src uim va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltw (va_code_Vspltw dst src uim) va_s0 dst src uim in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisw [@ "opaque_to_smt"] let va_code_Vspltisw dst src = (Ins (S.Vspltisw dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisw dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisw va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisw) (va_code_Vspltisw dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisw dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisw dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisw dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisw (va_code_Vspltisw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisb [@ "opaque_to_smt"] let va_code_Vspltisb dst src = (Ins (S.Vspltisb dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisb dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisb va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisb) (va_code_Vspltisb dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisb dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisb dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisb dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisb (va_code_Vspltisb 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_buffer [@ "opaque_to_smt"] let va_code_Load128_buffer h dst base offset t = (Ins (S.Load128 dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_buffer h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_buffer va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_buffer) (va_code_Load128_buffer h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128 dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128 dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_buffer h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_buffer (va_code_Load128_buffer h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_buffer [@ "opaque_to_smt"] let va_code_Store128_buffer h src base offset t = (Ins (S.Store128 src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_buffer h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_buffer va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_buffer) (va_code_Store128_buffer h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128 src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128 src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (va_eval_vec_opr va_old_s src) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_buffer h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_buffer (va_code_Store128_buffer h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer [@ "opaque_to_smt"] let va_code_Load128_word4_buffer h dst base t = (Ins (S.Load128Word4 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer) (va_code_Load128_word4_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer (va_code_Load128_word4_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Load128_word4_buffer_index h dst base offset t = (Ins (S.Load128Word4Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer_index) (va_code_Load128_word4_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer_index (va_code_Load128_word4_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer [@ "opaque_to_smt"] let va_code_Store128_word4_buffer h src base t = (Ins (S.Store128Word4 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer) (va_code_Store128_word4_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer (va_code_Store128_word4_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Store128_word4_buffer_index h src base offset t = (Ins (S.Store128Word4Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer_index) (va_code_Store128_word4_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer_index (va_code_Store128_word4_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer h dst base t = (Ins (S.Load128Byte16 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer) (va_code_Load128_byte16_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer (va_code_Load128_byte16_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer_index h dst base offset t = (Ins (S.Load128Byte16Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer_index) (va_code_Load128_byte16_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer_index (va_code_Load128_byte16_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer h src base t = (Ins (S.Store128Byte16 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer) (va_code_Store128_byte16_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer (va_code_Store128_byte16_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer_index h src base offset t = (Ins (S.Store128Byte16Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer_index) (va_code_Store128_byte16_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer_index (va_code_Store128_byte16_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma0 [@ "opaque_to_smt"] let va_code_SHA256_sigma0 dst src = (Ins (S.Vshasigmaw0 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma0 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma0) (va_code_SHA256_sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw0 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw0 dst src)) va_s0 in lemma_sha256_sigma0 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma0 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma0 (va_code_SHA256_sigma0 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma1 [@ "opaque_to_smt"] let va_code_SHA256_sigma1 dst src = (Ins (S.Vshasigmaw1 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma1 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma1) (va_code_SHA256_sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw1 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw1 dst src)) va_s0 in lemma_sha256_sigma1 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma1 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma1 (va_code_SHA256_sigma1 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma0 [@ "opaque_to_smt"] let va_code_SHA256_Sigma0 dst src = (Ins (S.Vshasigmaw2 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma0 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma0) (va_code_SHA256_Sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw2 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw2 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma2 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma0 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma0 (va_code_SHA256_Sigma0 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma1 [@ "opaque_to_smt"] let va_code_SHA256_Sigma1 dst src = (Ins (S.Vshasigmaw3 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma1 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma1) (va_code_SHA256_Sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw3 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw3 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma3 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma1 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma1 (va_code_SHA256_Sigma1 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsbox [@ "opaque_to_smt"] let va_code_Vsbox dst src = (Ins (S.Vsbox dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vsbox dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsbox va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vsbox) (va_code_Vsbox dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsbox dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsbox dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsbox dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsbox (va_code_Vsbox 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- RotWord [@ "opaque_to_smt"] let va_code_RotWord dst src1 src2 = (Ins (S.RotWord dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_RotWord dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_RotWord va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_RotWord) (va_code_RotWord dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.RotWord dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.RotWord dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_RotWord dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_RotWord (va_code_RotWord 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipher [@ "opaque_to_smt"] let va_code_Vcipher dst src1 src2 = (Ins (S.Vcipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipher (va_code_Vcipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipherlast [@ "opaque_to_smt"] let va_code_Vcipherlast dst src1 src2 = (Ins (S.Vcipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipherlast dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipherlast) (va_code_Vcipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipherlast dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipherlast dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipherlast (va_code_Vcipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipher [@ "opaque_to_smt"] let va_code_Vncipher dst src1 src2 = (Ins (S.Vncipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vncipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipher) (va_code_Vncipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vncipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vncipher (va_code_Vncipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipherlast [@ "opaque_to_smt"] let va_code_Vncipherlast dst src1 src2 = (Ins (S.Vncipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipherlast dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vncipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipherlast) (va_code_Vncipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipherlast dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Semantics_s.fst.checked", "Vale.PPC64LE.Memory_Sems.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.Types.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Hash.Definitions.fst.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.InsVector.fst" }
[ { "abbrev": true, "full_module": "Vale.PPC64LE.Semantics_s", "short_module": "S" }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2.Bits_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Sel", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Two_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 4, "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
dst: Vale.PPC64LE.Decls.va_operand_vec_opr -> src1: Vale.PPC64LE.Decls.va_operand_vec_opr -> src2: Vale.PPC64LE.Decls.va_operand_vec_opr -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_mod_vec_opr", "Prims.Nil", "Prims._assert", "Vale.PPC64LE.Decls.va_state_eq", "Vale.PPC64LE.Decls.va_update_ok", "Vale.PPC64LE.Decls.va_update_operand_vec_opr", "Vale.PPC64LE.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.InsVector.va_lemma_Vncipherlast", "Vale.PPC64LE.InsVector.va_code_Vncipherlast" ]
[]
false
false
false
false
false
let va_wpProof_Vncipherlast dst src1 src2 va_s0 va_k =
let va_sM, va_f0 = va_lemma_Vncipherlast (va_code_Vncipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Hacl.Bignum64.fst
Hacl.Bignum64.mod
val mod: len:BN.meta_len t_limbs -> BS.bn_mod_slow_safe_st t_limbs len
val mod: len:BN.meta_len t_limbs -> BS.bn_mod_slow_safe_st t_limbs len
let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 103, "end_line": 46, "start_col": 0, "start_line": 45 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: Hacl.Bignum.meta_len Hacl.Bignum64.t_limbs -> Hacl.Bignum.SafeAPI.bn_mod_slow_safe_st Hacl.Bignum64.t_limbs len
Prims.Tot
[ "total" ]
[]
[ "Hacl.Bignum.meta_len", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.Definitions.lbignum", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Bignum.SafeAPI.mk_bn_mod_slow_safe", "Hacl.Bignum.ModReduction.mk_bn_mod_slow", "Hacl.Bignum.AlmostMontgomery.__proj__Mkalmost_mont__item__precomp", "Hacl.Bignum64.kam", "Hacl.Bignum64.bn_slow_precomp", "Prims.bool" ]
[]
false
false
false
false
false
let mod len n a res =
BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res
false
Vale.PPC64LE.InsVector.fst
Vale.PPC64LE.InsVector.va_lemma_Vcipher
val va_lemma_Vcipher : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vcipher dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Def.Types_s.quad32_xor (Vale.AES.AES_BE_s.mix_columns (Vale.AES.AES_BE_s.shift_rows (Vale.AES.AES_common_s.sub_bytes (va_eval_vec_opr va_s0 src1)))) (va_eval_vec_opr va_s0 src2) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
val va_lemma_Vcipher : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vcipher dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Def.Types_s.quad32_xor (Vale.AES.AES_BE_s.mix_columns (Vale.AES.AES_BE_s.shift_rows (Vale.AES.AES_common_s.sub_bytes (va_eval_vec_opr va_s0 src1)))) (va_eval_vec_opr va_s0 src2) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.PPC64LE.InsVector.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1102, "start_col": 0, "start_line": 1097 }
module Vale.PPC64LE.InsVector open Vale.Def.Types_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Spec.Hash.Definitions open Spec.SHA2 friend Vale.PPC64LE.Decls module S = Vale.PPC64LE.Semantics_s #reset-options "--initial_fuel 2 --max_fuel 4 --max_ifuel 2 --z3rlimit 50" //-- Vmr [@ "opaque_to_smt"] let va_code_Vmr dst src = (Ins (S.Vmr dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vmr dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmr va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vmr) (va_code_Vmr dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmr dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmr dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmr dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmr (va_code_Vmr 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrd [@ "opaque_to_smt"] let va_code_Mfvsrd dst src = (Ins (S.Mfvsrd dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrd dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrd va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrd) (va_code_Mfvsrd dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrd dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrd dst src)) va_s0 in Vale.Arch.Types.hi64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrd dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrd (va_code_Mfvsrd 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrld [@ "opaque_to_smt"] let va_code_Mfvsrld dst src = (Ins (S.Mfvsrld dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrld dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrld va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrld) (va_code_Mfvsrld dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrld dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrld dst src)) va_s0 in Vale.Arch.Types.lo64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrld dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrld (va_code_Mfvsrld 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrdd [@ "opaque_to_smt"] let va_code_Mtvsrdd dst src1 src2 = (Ins (S.Mtvsrdd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrdd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrdd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Mtvsrdd) (va_code_Mtvsrdd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrdd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrdd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrdd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrdd (va_code_Mtvsrdd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrws [@ "opaque_to_smt"] let va_code_Mtvsrws dst src = (Ins (S.Mtvsrws dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrws dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrws va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mtvsrws) (va_code_Mtvsrws dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrws dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrws dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrws dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrws (va_code_Mtvsrws 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vadduwm [@ "opaque_to_smt"] let va_code_Vadduwm dst src1 src2 = (Ins (S.Vadduwm dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vadduwm dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vadduwm va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vadduwm) (va_code_Vadduwm dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vadduwm dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vadduwm dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vadduwm dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vadduwm (va_code_Vadduwm 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vxor [@ "opaque_to_smt"] let va_code_Vxor dst src1 src2 = (Ins (S.Vxor dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vxor dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vxor va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vxor) (va_code_Vxor dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vxor dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vxor dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vxor dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vxor (va_code_Vxor 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vand [@ "opaque_to_smt"] let va_code_Vand dst src1 src2 = (Ins (S.Vand dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vand dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vand va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vand) (va_code_Vand dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vand dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vand dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vand dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vand (va_code_Vand 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vslw [@ "opaque_to_smt"] let va_code_Vslw dst src1 src2 = (Ins (S.Vslw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vslw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vslw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vslw) (va_code_Vslw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vslw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vslw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vslw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vslw (va_code_Vslw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsrw [@ "opaque_to_smt"] let va_code_Vsrw dst src1 src2 = (Ins (S.Vsrw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsrw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsrw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsrw) (va_code_Vsrw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsrw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsrw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsrw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsrw (va_code_Vsrw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsl [@ "opaque_to_smt"] let va_code_Vsl dst src1 src2 = (Ins (S.Vsl dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsl dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsl va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsl) (va_code_Vsl dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsl dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsl dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsl dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsl (va_code_Vsl 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcmpequw [@ "opaque_to_smt"] let va_code_Vcmpequw dst src1 src2 = (Ins (S.Vcmpequw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcmpequw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcmpequw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcmpequw) (va_code_Vcmpequw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcmpequw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcmpequw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcmpequw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcmpequw (va_code_Vcmpequw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsldoi [@ "opaque_to_smt"] let va_code_Vsldoi dst src1 src2 count = (Ins (S.Vsldoi dst src1 src2 count)) [@ "opaque_to_smt"] let va_codegen_success_Vsldoi dst src1 src2 count = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsldoi va_b0 va_s0 dst src1 src2 count = va_reveal_opaque (`%va_code_Vsldoi) (va_code_Vsldoi dst src1 src2 count); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsldoi dst src1 src2 count)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsldoi dst src1 src2 count)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsldoi dst src1 src2 count va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsldoi (va_code_Vsldoi dst src1 src2 count) va_s0 dst src1 src2 count in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vmrghw [@ "opaque_to_smt"] let va_code_Vmrghw dst src1 src2 = (Ins (S.Vmrghw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vmrghw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmrghw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vmrghw) (va_code_Vmrghw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmrghw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmrghw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmrghw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmrghw (va_code_Vmrghw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xxmrghd [@ "opaque_to_smt"] let va_code_Xxmrghd dst src1 src2 = (Ins (S.Xxmrghd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Xxmrghd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xxmrghd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Xxmrghd) (va_code_Xxmrghd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Xxmrghd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Xxmrghd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xxmrghd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xxmrghd (va_code_Xxmrghd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsel [@ "opaque_to_smt"] let va_code_Vsel dst src1 src2 sel = (Ins (S.Vsel dst src1 src2 sel)) [@ "opaque_to_smt"] let va_codegen_success_Vsel dst src1 src2 sel = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsel va_b0 va_s0 dst src1 src2 sel = va_reveal_opaque (`%va_code_Vsel) (va_code_Vsel dst src1 src2 sel); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsel dst src1 src2 sel)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsel dst src1 src2 sel)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsel dst src1 src2 sel va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsel (va_code_Vsel dst src1 src2 sel) va_s0 dst src1 src2 sel in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltw [@ "opaque_to_smt"] let va_code_Vspltw dst src uim = (Ins (S.Vspltw dst src uim)) [@ "opaque_to_smt"] let va_codegen_success_Vspltw dst src uim = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltw va_b0 va_s0 dst src uim = va_reveal_opaque (`%va_code_Vspltw) (va_code_Vspltw dst src uim); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltw dst src uim)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltw dst src uim)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltw dst src uim va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltw (va_code_Vspltw dst src uim) va_s0 dst src uim in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisw [@ "opaque_to_smt"] let va_code_Vspltisw dst src = (Ins (S.Vspltisw dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisw dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisw va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisw) (va_code_Vspltisw dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisw dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisw dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisw dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisw (va_code_Vspltisw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisb [@ "opaque_to_smt"] let va_code_Vspltisb dst src = (Ins (S.Vspltisb dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisb dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisb va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisb) (va_code_Vspltisb dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisb dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisb dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisb dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisb (va_code_Vspltisb 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_buffer [@ "opaque_to_smt"] let va_code_Load128_buffer h dst base offset t = (Ins (S.Load128 dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_buffer h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_buffer va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_buffer) (va_code_Load128_buffer h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128 dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128 dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_buffer h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_buffer (va_code_Load128_buffer h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_buffer [@ "opaque_to_smt"] let va_code_Store128_buffer h src base offset t = (Ins (S.Store128 src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_buffer h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_buffer va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_buffer) (va_code_Store128_buffer h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128 src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128 src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (va_eval_vec_opr va_old_s src) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_buffer h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_buffer (va_code_Store128_buffer h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer [@ "opaque_to_smt"] let va_code_Load128_word4_buffer h dst base t = (Ins (S.Load128Word4 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer) (va_code_Load128_word4_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer (va_code_Load128_word4_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Load128_word4_buffer_index h dst base offset t = (Ins (S.Load128Word4Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer_index) (va_code_Load128_word4_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer_index (va_code_Load128_word4_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer [@ "opaque_to_smt"] let va_code_Store128_word4_buffer h src base t = (Ins (S.Store128Word4 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer) (va_code_Store128_word4_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer (va_code_Store128_word4_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Store128_word4_buffer_index h src base offset t = (Ins (S.Store128Word4Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer_index) (va_code_Store128_word4_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer_index (va_code_Store128_word4_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer h dst base t = (Ins (S.Load128Byte16 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer) (va_code_Load128_byte16_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer (va_code_Load128_byte16_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer_index h dst base offset t = (Ins (S.Load128Byte16Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer_index) (va_code_Load128_byte16_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer_index (va_code_Load128_byte16_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer h src base t = (Ins (S.Store128Byte16 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer) (va_code_Store128_byte16_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer (va_code_Store128_byte16_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer_index h src base offset t = (Ins (S.Store128Byte16Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer_index) (va_code_Store128_byte16_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer_index (va_code_Store128_byte16_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma0 [@ "opaque_to_smt"] let va_code_SHA256_sigma0 dst src = (Ins (S.Vshasigmaw0 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma0 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma0) (va_code_SHA256_sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw0 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw0 dst src)) va_s0 in lemma_sha256_sigma0 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma0 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma0 (va_code_SHA256_sigma0 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma1 [@ "opaque_to_smt"] let va_code_SHA256_sigma1 dst src = (Ins (S.Vshasigmaw1 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma1 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma1) (va_code_SHA256_sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw1 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw1 dst src)) va_s0 in lemma_sha256_sigma1 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma1 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma1 (va_code_SHA256_sigma1 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma0 [@ "opaque_to_smt"] let va_code_SHA256_Sigma0 dst src = (Ins (S.Vshasigmaw2 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma0 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma0) (va_code_SHA256_Sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw2 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw2 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma2 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma0 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma0 (va_code_SHA256_Sigma0 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma1 [@ "opaque_to_smt"] let va_code_SHA256_Sigma1 dst src = (Ins (S.Vshasigmaw3 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma1 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma1) (va_code_SHA256_Sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw3 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw3 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma3 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma1 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma1 (va_code_SHA256_Sigma1 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsbox [@ "opaque_to_smt"] let va_code_Vsbox dst src = (Ins (S.Vsbox dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vsbox dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsbox va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vsbox) (va_code_Vsbox dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsbox dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsbox dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsbox dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsbox (va_code_Vsbox 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- RotWord [@ "opaque_to_smt"] let va_code_RotWord dst src1 src2 = (Ins (S.RotWord dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_RotWord dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_RotWord va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_RotWord) (va_code_RotWord dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.RotWord dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.RotWord dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_RotWord dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_RotWord (va_code_RotWord 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipher [@ "opaque_to_smt"] let va_code_Vcipher dst src1 src2 = (Ins (S.Vcipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipher dst src1 src2 = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Semantics_s.fst.checked", "Vale.PPC64LE.Memory_Sems.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.Types.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Hash.Definitions.fst.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.InsVector.fst" }
[ { "abbrev": true, "full_module": "Vale.PPC64LE.Semantics_s", "short_module": "S" }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2.Bits_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Sel", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Two_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 4, "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> dst: Vale.PPC64LE.Decls.va_operand_vec_opr -> src1: Vale.PPC64LE.Decls.va_operand_vec_opr -> src2: Vale.PPC64LE.Decls.va_operand_vec_opr -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.State.state", "Vale.PPC64LE.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Prims.nat", "Vale.PPC64LE.Decls.va_eval_ins", "Vale.PPC64LE.Machine_s.Ins", "Vale.PPC64LE.Semantics_s.ins", "Vale.PPC64LE.Semantics_s.ocmp", "Vale.PPC64LE.Semantics_s.Vcipher", "Prims.unit", "Vale.PPC64LE.Decls.va_ins_lemma", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_reveal_opaque", "Vale.PPC64LE.InsVector.va_code_Vcipher" ]
[]
false
false
false
false
false
let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let va_old_s:va_state = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let va_sM, va_fM = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM)
false
Hacl.Bignum64.fst
Hacl.Bignum64.mod_exp_consttime
val mod_exp_consttime: len:BN.meta_len t_limbs -> BS.bn_mod_exp_safe_st t_limbs len
val mod_exp_consttime: len:BN.meta_len t_limbs -> BS.bn_mod_exp_safe_st t_limbs len
let mod_exp_consttime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 84, "end_line": 52, "start_col": 0, "start_line": 51 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len) let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res let mod_exp_vartime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_vt n a bBits b res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: Hacl.Bignum.meta_len Hacl.Bignum64.t_limbs -> Hacl.Bignum.SafeAPI.bn_mod_exp_safe_st Hacl.Bignum64.t_limbs len
Prims.Tot
[ "total" ]
[]
[ "Hacl.Bignum.meta_len", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.Definitions.lbignum", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.bits", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Bignum.Definitions.blocks0", "Lib.IntTypes.size", "Lib.IntTypes.max_size_t", "Hacl.Bignum.SafeAPI.mk_bn_mod_exp_safe", "Hacl.Bignum.Exponentiation.__proj__Mkexp__item__exp_check", "Hacl.Bignum64.ke", "Hacl.Bignum.Exponentiation.__proj__Mkexp__item__exp_ct", "Prims.bool" ]
[]
false
false
false
false
false
let mod_exp_consttime len n a bBits b res =
BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res
false
Effects.Def.fst
Effects.Def.st_laws
val st_laws : Prims.unit
let st_laws = monad_laws_via_eq st eq_st return_st bind_st
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 58, "end_line": 99, "start_col": 0, "start_line": 99 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.monad_laws_via_eq", "Effects.Def.st", "Effects.Def.eq_st", "Effects.Def.return_st", "Effects.Def.bind_st" ]
[]
false
false
false
true
false
let st_laws =
monad_laws_via_eq st eq_st return_st bind_st
false
Effects.Def.fst
Effects.Def.bind_ex
val bind_ex (a b: Type) (f: ex a) (g: (a -> Tot (ex b))) : ex b
val bind_ex (a b: Type) (f: ex a) (g: (a -> Tot (ex b))) : ex b
let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ())
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 38, "end_line": 116, "start_col": 0, "start_line": 112 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
a: Type -> b: Type -> f: Effects.Def.ex a -> g: (_: a -> Effects.Def.ex b) -> Effects.Def.ex b
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.ex", "FStar.FunctionalExtensionality.on_dom", "Prims.unit", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.None" ]
[]
false
false
false
true
false
let bind_ex (a b: Type) (f: ex a) (g: (a -> Tot (ex b))) : ex b =
on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ())
false
Effects.Def.fst
Effects.Def.handle
val handle (#a: Type) (f: ex a) (g: (unit -> Tot a)) : Tot a
val handle (#a: Type) (f: ex a) (g: (unit -> Tot a)) : Tot a
let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 17, "end_line": 128, "start_col": 0, "start_line": 124 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
f: Effects.Def.ex a -> g: (_: Prims.unit -> a) -> a
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.ex", "Prims.unit" ]
[]
false
false
false
true
false
let handle (#a: Type) (f: ex a) (g: (unit -> Tot a)) : Tot a =
match f () with | None -> g () | Some x -> x
false
Effects.Def.fst
Effects.Def.stexn_laws
val stexn_laws : Prims.unit
let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 73, "end_line": 149, "start_col": 0, "start_line": 149 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.monad_laws_via_eq", "Effects.Def.stexn", "Effects.Def.eq_stexn", "Effects.Def.return_stexn", "Effects.Def.bind_stexn" ]
[]
false
false
false
true
false
let stexn_laws =
monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn
false
Vale.PPC64LE.InsVector.fst
Vale.PPC64LE.InsVector.va_lemma_Vncipher
val va_lemma_Vncipher : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vncipher dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.AES.AES_BE_s.inv_mix_columns (Vale.Def.Types_s.quad32_xor (Vale.AES.AES_common_s.inv_sub_bytes (Vale.AES.AES_BE_s.inv_shift_rows (va_eval_vec_opr va_s0 src1))) (va_eval_vec_opr va_s0 src2)) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
val va_lemma_Vncipher : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vncipher dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.AES.AES_BE_s.inv_mix_columns (Vale.Def.Types_s.quad32_xor (Vale.AES.AES_common_s.inv_sub_bytes (Vale.AES.AES_BE_s.inv_shift_rows (va_eval_vec_opr va_s0 src1))) (va_eval_vec_opr va_s0 src2)) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
let va_lemma_Vncipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipher) (va_code_Vncipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipher dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.PPC64LE.InsVector.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1161, "start_col": 0, "start_line": 1156 }
module Vale.PPC64LE.InsVector open Vale.Def.Types_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Spec.Hash.Definitions open Spec.SHA2 friend Vale.PPC64LE.Decls module S = Vale.PPC64LE.Semantics_s #reset-options "--initial_fuel 2 --max_fuel 4 --max_ifuel 2 --z3rlimit 50" //-- Vmr [@ "opaque_to_smt"] let va_code_Vmr dst src = (Ins (S.Vmr dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vmr dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmr va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vmr) (va_code_Vmr dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmr dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmr dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmr dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmr (va_code_Vmr 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrd [@ "opaque_to_smt"] let va_code_Mfvsrd dst src = (Ins (S.Mfvsrd dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrd dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrd va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrd) (va_code_Mfvsrd dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrd dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrd dst src)) va_s0 in Vale.Arch.Types.hi64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrd dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrd (va_code_Mfvsrd 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrld [@ "opaque_to_smt"] let va_code_Mfvsrld dst src = (Ins (S.Mfvsrld dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrld dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrld va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrld) (va_code_Mfvsrld dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrld dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrld dst src)) va_s0 in Vale.Arch.Types.lo64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrld dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrld (va_code_Mfvsrld 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrdd [@ "opaque_to_smt"] let va_code_Mtvsrdd dst src1 src2 = (Ins (S.Mtvsrdd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrdd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrdd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Mtvsrdd) (va_code_Mtvsrdd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrdd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrdd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrdd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrdd (va_code_Mtvsrdd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrws [@ "opaque_to_smt"] let va_code_Mtvsrws dst src = (Ins (S.Mtvsrws dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrws dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrws va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mtvsrws) (va_code_Mtvsrws dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrws dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrws dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrws dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrws (va_code_Mtvsrws 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vadduwm [@ "opaque_to_smt"] let va_code_Vadduwm dst src1 src2 = (Ins (S.Vadduwm dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vadduwm dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vadduwm va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vadduwm) (va_code_Vadduwm dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vadduwm dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vadduwm dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vadduwm dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vadduwm (va_code_Vadduwm 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vxor [@ "opaque_to_smt"] let va_code_Vxor dst src1 src2 = (Ins (S.Vxor dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vxor dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vxor va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vxor) (va_code_Vxor dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vxor dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vxor dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vxor dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vxor (va_code_Vxor 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vand [@ "opaque_to_smt"] let va_code_Vand dst src1 src2 = (Ins (S.Vand dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vand dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vand va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vand) (va_code_Vand dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vand dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vand dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vand dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vand (va_code_Vand 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vslw [@ "opaque_to_smt"] let va_code_Vslw dst src1 src2 = (Ins (S.Vslw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vslw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vslw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vslw) (va_code_Vslw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vslw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vslw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vslw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vslw (va_code_Vslw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsrw [@ "opaque_to_smt"] let va_code_Vsrw dst src1 src2 = (Ins (S.Vsrw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsrw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsrw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsrw) (va_code_Vsrw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsrw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsrw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsrw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsrw (va_code_Vsrw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsl [@ "opaque_to_smt"] let va_code_Vsl dst src1 src2 = (Ins (S.Vsl dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsl dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsl va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsl) (va_code_Vsl dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsl dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsl dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsl dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsl (va_code_Vsl 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcmpequw [@ "opaque_to_smt"] let va_code_Vcmpequw dst src1 src2 = (Ins (S.Vcmpequw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcmpequw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcmpequw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcmpequw) (va_code_Vcmpequw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcmpequw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcmpequw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcmpequw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcmpequw (va_code_Vcmpequw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsldoi [@ "opaque_to_smt"] let va_code_Vsldoi dst src1 src2 count = (Ins (S.Vsldoi dst src1 src2 count)) [@ "opaque_to_smt"] let va_codegen_success_Vsldoi dst src1 src2 count = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsldoi va_b0 va_s0 dst src1 src2 count = va_reveal_opaque (`%va_code_Vsldoi) (va_code_Vsldoi dst src1 src2 count); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsldoi dst src1 src2 count)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsldoi dst src1 src2 count)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsldoi dst src1 src2 count va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsldoi (va_code_Vsldoi dst src1 src2 count) va_s0 dst src1 src2 count in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vmrghw [@ "opaque_to_smt"] let va_code_Vmrghw dst src1 src2 = (Ins (S.Vmrghw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vmrghw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmrghw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vmrghw) (va_code_Vmrghw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmrghw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmrghw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmrghw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmrghw (va_code_Vmrghw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xxmrghd [@ "opaque_to_smt"] let va_code_Xxmrghd dst src1 src2 = (Ins (S.Xxmrghd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Xxmrghd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xxmrghd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Xxmrghd) (va_code_Xxmrghd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Xxmrghd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Xxmrghd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xxmrghd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xxmrghd (va_code_Xxmrghd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsel [@ "opaque_to_smt"] let va_code_Vsel dst src1 src2 sel = (Ins (S.Vsel dst src1 src2 sel)) [@ "opaque_to_smt"] let va_codegen_success_Vsel dst src1 src2 sel = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsel va_b0 va_s0 dst src1 src2 sel = va_reveal_opaque (`%va_code_Vsel) (va_code_Vsel dst src1 src2 sel); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsel dst src1 src2 sel)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsel dst src1 src2 sel)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsel dst src1 src2 sel va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsel (va_code_Vsel dst src1 src2 sel) va_s0 dst src1 src2 sel in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltw [@ "opaque_to_smt"] let va_code_Vspltw dst src uim = (Ins (S.Vspltw dst src uim)) [@ "opaque_to_smt"] let va_codegen_success_Vspltw dst src uim = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltw va_b0 va_s0 dst src uim = va_reveal_opaque (`%va_code_Vspltw) (va_code_Vspltw dst src uim); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltw dst src uim)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltw dst src uim)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltw dst src uim va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltw (va_code_Vspltw dst src uim) va_s0 dst src uim in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisw [@ "opaque_to_smt"] let va_code_Vspltisw dst src = (Ins (S.Vspltisw dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisw dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisw va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisw) (va_code_Vspltisw dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisw dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisw dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisw dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisw (va_code_Vspltisw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisb [@ "opaque_to_smt"] let va_code_Vspltisb dst src = (Ins (S.Vspltisb dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisb dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisb va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisb) (va_code_Vspltisb dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisb dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisb dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisb dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisb (va_code_Vspltisb 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_buffer [@ "opaque_to_smt"] let va_code_Load128_buffer h dst base offset t = (Ins (S.Load128 dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_buffer h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_buffer va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_buffer) (va_code_Load128_buffer h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128 dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128 dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_buffer h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_buffer (va_code_Load128_buffer h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_buffer [@ "opaque_to_smt"] let va_code_Store128_buffer h src base offset t = (Ins (S.Store128 src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_buffer h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_buffer va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_buffer) (va_code_Store128_buffer h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128 src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128 src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (va_eval_vec_opr va_old_s src) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_buffer h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_buffer (va_code_Store128_buffer h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer [@ "opaque_to_smt"] let va_code_Load128_word4_buffer h dst base t = (Ins (S.Load128Word4 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer) (va_code_Load128_word4_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer (va_code_Load128_word4_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Load128_word4_buffer_index h dst base offset t = (Ins (S.Load128Word4Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer_index) (va_code_Load128_word4_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer_index (va_code_Load128_word4_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer [@ "opaque_to_smt"] let va_code_Store128_word4_buffer h src base t = (Ins (S.Store128Word4 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer) (va_code_Store128_word4_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer (va_code_Store128_word4_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Store128_word4_buffer_index h src base offset t = (Ins (S.Store128Word4Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer_index) (va_code_Store128_word4_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer_index (va_code_Store128_word4_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer h dst base t = (Ins (S.Load128Byte16 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer) (va_code_Load128_byte16_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer (va_code_Load128_byte16_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer_index h dst base offset t = (Ins (S.Load128Byte16Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer_index) (va_code_Load128_byte16_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer_index (va_code_Load128_byte16_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer h src base t = (Ins (S.Store128Byte16 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer) (va_code_Store128_byte16_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer (va_code_Store128_byte16_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer_index h src base offset t = (Ins (S.Store128Byte16Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer_index) (va_code_Store128_byte16_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer_index (va_code_Store128_byte16_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma0 [@ "opaque_to_smt"] let va_code_SHA256_sigma0 dst src = (Ins (S.Vshasigmaw0 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma0 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma0) (va_code_SHA256_sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw0 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw0 dst src)) va_s0 in lemma_sha256_sigma0 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma0 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma0 (va_code_SHA256_sigma0 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma1 [@ "opaque_to_smt"] let va_code_SHA256_sigma1 dst src = (Ins (S.Vshasigmaw1 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma1 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma1) (va_code_SHA256_sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw1 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw1 dst src)) va_s0 in lemma_sha256_sigma1 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma1 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma1 (va_code_SHA256_sigma1 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma0 [@ "opaque_to_smt"] let va_code_SHA256_Sigma0 dst src = (Ins (S.Vshasigmaw2 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma0 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma0) (va_code_SHA256_Sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw2 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw2 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma2 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma0 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma0 (va_code_SHA256_Sigma0 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma1 [@ "opaque_to_smt"] let va_code_SHA256_Sigma1 dst src = (Ins (S.Vshasigmaw3 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma1 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma1) (va_code_SHA256_Sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw3 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw3 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma3 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma1 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma1 (va_code_SHA256_Sigma1 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsbox [@ "opaque_to_smt"] let va_code_Vsbox dst src = (Ins (S.Vsbox dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vsbox dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsbox va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vsbox) (va_code_Vsbox dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsbox dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsbox dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsbox dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsbox (va_code_Vsbox 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- RotWord [@ "opaque_to_smt"] let va_code_RotWord dst src1 src2 = (Ins (S.RotWord dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_RotWord dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_RotWord va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_RotWord) (va_code_RotWord dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.RotWord dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.RotWord dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_RotWord dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_RotWord (va_code_RotWord 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipher [@ "opaque_to_smt"] let va_code_Vcipher dst src1 src2 = (Ins (S.Vcipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipher (va_code_Vcipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipherlast [@ "opaque_to_smt"] let va_code_Vcipherlast dst src1 src2 = (Ins (S.Vcipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipherlast dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipherlast) (va_code_Vcipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipherlast dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipherlast dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipherlast (va_code_Vcipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipher [@ "opaque_to_smt"] let va_code_Vncipher dst src1 src2 = (Ins (S.Vncipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipher dst src1 src2 = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Semantics_s.fst.checked", "Vale.PPC64LE.Memory_Sems.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.Types.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Hash.Definitions.fst.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.InsVector.fst" }
[ { "abbrev": true, "full_module": "Vale.PPC64LE.Semantics_s", "short_module": "S" }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2.Bits_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Sel", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Two_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 4, "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> dst: Vale.PPC64LE.Decls.va_operand_vec_opr -> src1: Vale.PPC64LE.Decls.va_operand_vec_opr -> src2: Vale.PPC64LE.Decls.va_operand_vec_opr -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.State.state", "Vale.PPC64LE.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Prims.nat", "Vale.PPC64LE.Decls.va_eval_ins", "Vale.PPC64LE.Machine_s.Ins", "Vale.PPC64LE.Semantics_s.ins", "Vale.PPC64LE.Semantics_s.ocmp", "Vale.PPC64LE.Semantics_s.Vncipher", "Prims.unit", "Vale.PPC64LE.Decls.va_ins_lemma", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_reveal_opaque", "Vale.PPC64LE.InsVector.va_code_Vncipher" ]
[]
false
false
false
false
false
let va_lemma_Vncipher va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_Vncipher) (va_code_Vncipher dst src1 src2); let va_old_s:va_state = va_s0 in va_ins_lemma (Ins (S.Vncipher dst src1 src2)) va_s0; let va_sM, va_fM = va_eval_ins (Ins (S.Vncipher dst src1 src2)) va_s0 in (va_sM, va_fM)
false
Vale.PPC64LE.InsVector.fst
Vale.PPC64LE.InsVector.va_lemma_Vncipherlast
val va_lemma_Vncipherlast : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vncipherlast dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Def.Types_s.quad32_xor (Vale.AES.AES_common_s.inv_sub_bytes (Vale.AES.AES_BE_s.inv_shift_rows (va_eval_vec_opr va_s0 src1))) (va_eval_vec_opr va_s0 src2) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
val va_lemma_Vncipherlast : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vncipherlast dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Def.Types_s.quad32_xor (Vale.AES.AES_common_s.inv_sub_bytes (Vale.AES.AES_BE_s.inv_shift_rows (va_eval_vec_opr va_s0 src1))) (va_eval_vec_opr va_s0 src2) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
let va_lemma_Vncipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipherlast) (va_code_Vncipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipherlast dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.PPC64LE.InsVector.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1190, "start_col": 0, "start_line": 1185 }
module Vale.PPC64LE.InsVector open Vale.Def.Types_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Spec.Hash.Definitions open Spec.SHA2 friend Vale.PPC64LE.Decls module S = Vale.PPC64LE.Semantics_s #reset-options "--initial_fuel 2 --max_fuel 4 --max_ifuel 2 --z3rlimit 50" //-- Vmr [@ "opaque_to_smt"] let va_code_Vmr dst src = (Ins (S.Vmr dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vmr dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmr va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vmr) (va_code_Vmr dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmr dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmr dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmr dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmr (va_code_Vmr 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrd [@ "opaque_to_smt"] let va_code_Mfvsrd dst src = (Ins (S.Mfvsrd dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrd dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrd va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrd) (va_code_Mfvsrd dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrd dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrd dst src)) va_s0 in Vale.Arch.Types.hi64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrd dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrd (va_code_Mfvsrd 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrld [@ "opaque_to_smt"] let va_code_Mfvsrld dst src = (Ins (S.Mfvsrld dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrld dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrld va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrld) (va_code_Mfvsrld dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrld dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrld dst src)) va_s0 in Vale.Arch.Types.lo64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrld dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrld (va_code_Mfvsrld 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrdd [@ "opaque_to_smt"] let va_code_Mtvsrdd dst src1 src2 = (Ins (S.Mtvsrdd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrdd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrdd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Mtvsrdd) (va_code_Mtvsrdd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrdd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrdd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrdd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrdd (va_code_Mtvsrdd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrws [@ "opaque_to_smt"] let va_code_Mtvsrws dst src = (Ins (S.Mtvsrws dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrws dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrws va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mtvsrws) (va_code_Mtvsrws dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrws dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrws dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrws dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrws (va_code_Mtvsrws 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vadduwm [@ "opaque_to_smt"] let va_code_Vadduwm dst src1 src2 = (Ins (S.Vadduwm dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vadduwm dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vadduwm va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vadduwm) (va_code_Vadduwm dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vadduwm dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vadduwm dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vadduwm dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vadduwm (va_code_Vadduwm 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vxor [@ "opaque_to_smt"] let va_code_Vxor dst src1 src2 = (Ins (S.Vxor dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vxor dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vxor va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vxor) (va_code_Vxor dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vxor dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vxor dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vxor dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vxor (va_code_Vxor 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vand [@ "opaque_to_smt"] let va_code_Vand dst src1 src2 = (Ins (S.Vand dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vand dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vand va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vand) (va_code_Vand dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vand dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vand dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vand dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vand (va_code_Vand 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vslw [@ "opaque_to_smt"] let va_code_Vslw dst src1 src2 = (Ins (S.Vslw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vslw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vslw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vslw) (va_code_Vslw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vslw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vslw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vslw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vslw (va_code_Vslw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsrw [@ "opaque_to_smt"] let va_code_Vsrw dst src1 src2 = (Ins (S.Vsrw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsrw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsrw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsrw) (va_code_Vsrw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsrw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsrw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsrw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsrw (va_code_Vsrw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsl [@ "opaque_to_smt"] let va_code_Vsl dst src1 src2 = (Ins (S.Vsl dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsl dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsl va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsl) (va_code_Vsl dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsl dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsl dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsl dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsl (va_code_Vsl 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcmpequw [@ "opaque_to_smt"] let va_code_Vcmpequw dst src1 src2 = (Ins (S.Vcmpequw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcmpequw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcmpequw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcmpequw) (va_code_Vcmpequw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcmpequw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcmpequw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcmpequw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcmpequw (va_code_Vcmpequw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsldoi [@ "opaque_to_smt"] let va_code_Vsldoi dst src1 src2 count = (Ins (S.Vsldoi dst src1 src2 count)) [@ "opaque_to_smt"] let va_codegen_success_Vsldoi dst src1 src2 count = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsldoi va_b0 va_s0 dst src1 src2 count = va_reveal_opaque (`%va_code_Vsldoi) (va_code_Vsldoi dst src1 src2 count); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsldoi dst src1 src2 count)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsldoi dst src1 src2 count)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsldoi dst src1 src2 count va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsldoi (va_code_Vsldoi dst src1 src2 count) va_s0 dst src1 src2 count in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vmrghw [@ "opaque_to_smt"] let va_code_Vmrghw dst src1 src2 = (Ins (S.Vmrghw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vmrghw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmrghw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vmrghw) (va_code_Vmrghw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmrghw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmrghw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmrghw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmrghw (va_code_Vmrghw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xxmrghd [@ "opaque_to_smt"] let va_code_Xxmrghd dst src1 src2 = (Ins (S.Xxmrghd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Xxmrghd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xxmrghd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Xxmrghd) (va_code_Xxmrghd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Xxmrghd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Xxmrghd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xxmrghd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xxmrghd (va_code_Xxmrghd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsel [@ "opaque_to_smt"] let va_code_Vsel dst src1 src2 sel = (Ins (S.Vsel dst src1 src2 sel)) [@ "opaque_to_smt"] let va_codegen_success_Vsel dst src1 src2 sel = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsel va_b0 va_s0 dst src1 src2 sel = va_reveal_opaque (`%va_code_Vsel) (va_code_Vsel dst src1 src2 sel); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsel dst src1 src2 sel)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsel dst src1 src2 sel)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsel dst src1 src2 sel va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsel (va_code_Vsel dst src1 src2 sel) va_s0 dst src1 src2 sel in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltw [@ "opaque_to_smt"] let va_code_Vspltw dst src uim = (Ins (S.Vspltw dst src uim)) [@ "opaque_to_smt"] let va_codegen_success_Vspltw dst src uim = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltw va_b0 va_s0 dst src uim = va_reveal_opaque (`%va_code_Vspltw) (va_code_Vspltw dst src uim); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltw dst src uim)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltw dst src uim)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltw dst src uim va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltw (va_code_Vspltw dst src uim) va_s0 dst src uim in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisw [@ "opaque_to_smt"] let va_code_Vspltisw dst src = (Ins (S.Vspltisw dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisw dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisw va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisw) (va_code_Vspltisw dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisw dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisw dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisw dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisw (va_code_Vspltisw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisb [@ "opaque_to_smt"] let va_code_Vspltisb dst src = (Ins (S.Vspltisb dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisb dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisb va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisb) (va_code_Vspltisb dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisb dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisb dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisb dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisb (va_code_Vspltisb 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_buffer [@ "opaque_to_smt"] let va_code_Load128_buffer h dst base offset t = (Ins (S.Load128 dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_buffer h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_buffer va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_buffer) (va_code_Load128_buffer h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128 dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128 dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_buffer h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_buffer (va_code_Load128_buffer h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_buffer [@ "opaque_to_smt"] let va_code_Store128_buffer h src base offset t = (Ins (S.Store128 src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_buffer h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_buffer va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_buffer) (va_code_Store128_buffer h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128 src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128 src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (va_eval_vec_opr va_old_s src) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_buffer h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_buffer (va_code_Store128_buffer h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer [@ "opaque_to_smt"] let va_code_Load128_word4_buffer h dst base t = (Ins (S.Load128Word4 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer) (va_code_Load128_word4_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer (va_code_Load128_word4_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Load128_word4_buffer_index h dst base offset t = (Ins (S.Load128Word4Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer_index) (va_code_Load128_word4_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer_index (va_code_Load128_word4_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer [@ "opaque_to_smt"] let va_code_Store128_word4_buffer h src base t = (Ins (S.Store128Word4 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer) (va_code_Store128_word4_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer (va_code_Store128_word4_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Store128_word4_buffer_index h src base offset t = (Ins (S.Store128Word4Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer_index) (va_code_Store128_word4_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer_index (va_code_Store128_word4_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer h dst base t = (Ins (S.Load128Byte16 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer) (va_code_Load128_byte16_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer (va_code_Load128_byte16_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer_index h dst base offset t = (Ins (S.Load128Byte16Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer_index) (va_code_Load128_byte16_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer_index (va_code_Load128_byte16_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer h src base t = (Ins (S.Store128Byte16 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer) (va_code_Store128_byte16_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer (va_code_Store128_byte16_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer_index h src base offset t = (Ins (S.Store128Byte16Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer_index) (va_code_Store128_byte16_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer_index (va_code_Store128_byte16_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma0 [@ "opaque_to_smt"] let va_code_SHA256_sigma0 dst src = (Ins (S.Vshasigmaw0 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma0 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma0) (va_code_SHA256_sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw0 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw0 dst src)) va_s0 in lemma_sha256_sigma0 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma0 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma0 (va_code_SHA256_sigma0 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma1 [@ "opaque_to_smt"] let va_code_SHA256_sigma1 dst src = (Ins (S.Vshasigmaw1 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma1 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma1) (va_code_SHA256_sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw1 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw1 dst src)) va_s0 in lemma_sha256_sigma1 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma1 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma1 (va_code_SHA256_sigma1 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma0 [@ "opaque_to_smt"] let va_code_SHA256_Sigma0 dst src = (Ins (S.Vshasigmaw2 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma0 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma0) (va_code_SHA256_Sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw2 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw2 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma2 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma0 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma0 (va_code_SHA256_Sigma0 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma1 [@ "opaque_to_smt"] let va_code_SHA256_Sigma1 dst src = (Ins (S.Vshasigmaw3 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma1 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma1) (va_code_SHA256_Sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw3 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw3 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma3 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma1 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma1 (va_code_SHA256_Sigma1 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsbox [@ "opaque_to_smt"] let va_code_Vsbox dst src = (Ins (S.Vsbox dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vsbox dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsbox va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vsbox) (va_code_Vsbox dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsbox dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsbox dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsbox dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsbox (va_code_Vsbox 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- RotWord [@ "opaque_to_smt"] let va_code_RotWord dst src1 src2 = (Ins (S.RotWord dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_RotWord dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_RotWord va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_RotWord) (va_code_RotWord dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.RotWord dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.RotWord dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_RotWord dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_RotWord (va_code_RotWord 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipher [@ "opaque_to_smt"] let va_code_Vcipher dst src1 src2 = (Ins (S.Vcipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipher (va_code_Vcipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipherlast [@ "opaque_to_smt"] let va_code_Vcipherlast dst src1 src2 = (Ins (S.Vcipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipherlast dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipherlast) (va_code_Vcipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipherlast dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipherlast dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipherlast (va_code_Vcipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipher [@ "opaque_to_smt"] let va_code_Vncipher dst src1 src2 = (Ins (S.Vncipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vncipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipher) (va_code_Vncipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vncipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vncipher (va_code_Vncipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipherlast [@ "opaque_to_smt"] let va_code_Vncipherlast dst src1 src2 = (Ins (S.Vncipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipherlast dst src1 src2 = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Semantics_s.fst.checked", "Vale.PPC64LE.Memory_Sems.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.Types.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Hash.Definitions.fst.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.InsVector.fst" }
[ { "abbrev": true, "full_module": "Vale.PPC64LE.Semantics_s", "short_module": "S" }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2.Bits_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Sel", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Two_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 4, "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> dst: Vale.PPC64LE.Decls.va_operand_vec_opr -> src1: Vale.PPC64LE.Decls.va_operand_vec_opr -> src2: Vale.PPC64LE.Decls.va_operand_vec_opr -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.State.state", "Vale.PPC64LE.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Prims.nat", "Vale.PPC64LE.Decls.va_eval_ins", "Vale.PPC64LE.Machine_s.Ins", "Vale.PPC64LE.Semantics_s.ins", "Vale.PPC64LE.Semantics_s.ocmp", "Vale.PPC64LE.Semantics_s.Vncipherlast", "Prims.unit", "Vale.PPC64LE.Decls.va_ins_lemma", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_reveal_opaque", "Vale.PPC64LE.InsVector.va_code_Vncipherlast" ]
[]
false
false
false
false
false
let va_lemma_Vncipherlast va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_Vncipherlast) (va_code_Vncipherlast dst src1 src2); let va_old_s:va_state = va_s0 in va_ins_lemma (Ins (S.Vncipherlast dst src1 src2)) va_s0; let va_sM, va_fM = va_eval_ins (Ins (S.Vncipherlast dst src1 src2)) va_s0 in (va_sM, va_fM)
false
Hacl.Bignum64.fst
Hacl.Bignum64.mod_inv_prime_vartime_precomp
val mod_inv_prime_vartime_precomp: len:Ghost.erased _ -> BS.bn_mod_inv_prime_ctx_st t_limbs len
val mod_inv_prime_vartime_precomp: len:Ghost.erased _ -> BS.bn_mod_inv_prime_ctx_st t_limbs len
let mod_inv_prime_vartime_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_inv_prime_ctx len (BI.mk_bn_mod_inv_prime_precomp len1 (ke len1).BE.exp_vt_precomp) k a res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 77, "end_line": 78, "start_col": 0, "start_line": 75 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len) let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res let mod_exp_vartime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_vt n a bBits b res let mod_exp_consttime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res let mod_inv_prime_vartime len n a res = BS.mk_bn_mod_inv_prime_safe len (ke len).BE.exp_vt n a res let mont_ctx_init len r n = MA.bn_field_init len (ke len).BE.precompr2 r n let mont_ctx_free k = MA.bn_field_free k let mod_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.bn_mod_ctx len (bn_slow_precomp len1) k a res let mod_exp_vartime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_vt_precomp k a bBits b res let mod_exp_consttime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_ct_precomp k a bBits b res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: FStar.Ghost.erased (Hacl.Bignum.meta_len Hacl.Bignum64.t_limbs) -> Hacl.Bignum.SafeAPI.bn_mod_inv_prime_ctx_st Hacl.Bignum64.t_limbs (FStar.Ghost.reveal len)
Prims.Tot
[ "total" ]
[]
[ "FStar.Ghost.erased", "Hacl.Bignum.meta_len", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.MontArithmetic.pbn_mont_ctx", "Hacl.Bignum.Definitions.lbignum", "FStar.Ghost.reveal", "Hacl.Bignum.SafeAPI.mk_bn_mod_inv_prime_ctx", "Hacl.Bignum.ModInv.mk_bn_mod_inv_prime_precomp", "Hacl.Bignum.Exponentiation.__proj__Mkexp__item__exp_vt_precomp", "Hacl.Bignum64.ke", "Prims.unit", "Hacl.Bignum.MontArithmetic.bn_field_get_len" ]
[]
false
false
false
false
false
let mod_inv_prime_vartime_precomp len k a res =
let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_inv_prime_ctx len (BI.mk_bn_mod_inv_prime_precomp len1 (ke len1).BE.exp_vt_precomp) k a res
false
Effects.Def.fst
Effects.Def.ex_laws
val ex_laws : Prims.unit
let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 58, "end_line": 130, "start_col": 0, "start_line": 130 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.monad_laws_via_eq", "Effects.Def.ex", "Effects.Def.eq_ex", "Effects.Def.return_ex", "Effects.Def.bind_ex" ]
[]
false
false
false
true
false
let ex_laws =
monad_laws_via_eq ex eq_ex return_ex bind_ex
false
FStar.Class.TotalOrder.Raw.fst
FStar.Class.TotalOrder.Raw.raw_comparator
val raw_comparator : a: Type -> Type
let raw_comparator (a:Type) = a -> a -> order
{ "file_name": "ulib/FStar.Class.TotalOrder.Raw.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 45, "end_line": 25, "start_col": 0, "start_line": 25 }
(* Copyright 2008-2018 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 FStar.Class.TotalOrder.Raw open FStar.Order let flip = function | Lt -> Gt | Eq -> Eq | Gt -> Lt
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Tactics.Typeclasses.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Order.fst.checked" ], "interface_file": false, "source_file": "FStar.Class.TotalOrder.Raw.fst" }
[ { "abbrev": false, "full_module": "FStar.Order", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "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
a: Type -> Type
Prims.Tot
[ "total" ]
[]
[ "FStar.Order.order" ]
[]
false
false
false
true
true
let raw_comparator (a: Type) =
a -> a -> order
false
Effects.Def.fst
Effects.Def.morphism_lift_ex_stexn
val morphism_lift_ex_stexn : Prims.unit
let morphism_lift_ex_stexn = morphism_laws_via_eq ex stexn eq_stexn return_ex bind_ex return_stexn bind_stexn lift_ex_stexn
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 22, "end_line": 194, "start_col": 0, "start_line": 190 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1) let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn (* ******************************************************************************) (* Effect (exnst a) : A combined monad, state over exceptions *) (* ******************************************************************************) let exnst (a:Type) = restricted_t s (fun _ -> (option (a * s))) let eq_exnst (a:Type) (x:exnst a) (y:exnst a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_exnst (a:Type) (x:a) : exnst a = on_dom s (fun s -> Some (x, s)) let bind_exnst (a:Type) (b:Type) (f:exnst a) (g: a -> Tot (exnst b)) : exnst b = on_dom s (fun s0 -> match f s0 with | None -> None | Some (x, s1) -> g x s1) let exnst_laws = monad_laws_via_eq exnst eq_exnst return_exnst bind_exnst (* ******************************************************************************) (* Morphism: st -> stexn *) (* ******************************************************************************) let lift_st_stexn (a:Type) (f:st a) : stexn a = on_dom s (fun s0 -> let x, s1 = f s0 in Some x, s1) let morphism_lift_st_exn = morphism_laws_via_eq st stexn eq_stexn return_st bind_st return_stexn bind_stexn lift_st_stexn (* ******************************************************************************) (* Morphism: exn -> stexn *) (* ******************************************************************************) let lift_ex_stexn (a:Type) (f:ex a) : stexn a = on_dom s (fun s0 -> f (), s0)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.morphism_laws_via_eq", "Effects.Def.ex", "Effects.Def.stexn", "Effects.Def.eq_stexn", "Effects.Def.return_ex", "Effects.Def.bind_ex", "Effects.Def.return_stexn", "Effects.Def.bind_stexn", "Effects.Def.lift_ex_stexn" ]
[]
false
false
false
true
false
let morphism_lift_ex_stexn =
morphism_laws_via_eq ex stexn eq_stexn return_ex bind_ex return_stexn bind_stexn lift_ex_stexn
false
Hacl.Bignum64.fst
Hacl.Bignum64.mod_exp_vartime_precomp
val mod_exp_vartime_precomp: len:Ghost.erased _ -> BS.bn_mod_exp_ctx_st t_limbs len
val mod_exp_vartime_precomp: len:Ghost.erased _ -> BS.bn_mod_exp_ctx_st t_limbs len
let mod_exp_vartime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_vt_precomp k a bBits b res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 70, "end_line": 69, "start_col": 0, "start_line": 67 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len) let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res let mod_exp_vartime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_vt n a bBits b res let mod_exp_consttime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res let mod_inv_prime_vartime len n a res = BS.mk_bn_mod_inv_prime_safe len (ke len).BE.exp_vt n a res let mont_ctx_init len r n = MA.bn_field_init len (ke len).BE.precompr2 r n let mont_ctx_free k = MA.bn_field_free k let mod_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.bn_mod_ctx len (bn_slow_precomp len1) k a res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: FStar.Ghost.erased (Hacl.Bignum.meta_len Hacl.Bignum64.t_limbs) -> Hacl.Bignum.SafeAPI.bn_mod_exp_ctx_st Hacl.Bignum64.t_limbs (FStar.Ghost.reveal len)
Prims.Tot
[ "total" ]
[]
[ "FStar.Ghost.erased", "Hacl.Bignum.meta_len", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.MontArithmetic.pbn_mont_ctx", "Hacl.Bignum.Definitions.lbignum", "FStar.Ghost.reveal", "Lib.IntTypes.size_t", "Hacl.Bignum.Definitions.blocks0", "Lib.IntTypes.size", "Lib.IntTypes.bits", "Hacl.Bignum.SafeAPI.mk_bn_mod_exp_ctx", "Hacl.Bignum.Exponentiation.__proj__Mkexp__item__exp_vt_precomp", "Hacl.Bignum64.ke", "Prims.unit", "Hacl.Bignum.MontArithmetic.bn_field_get_len" ]
[]
false
false
false
false
false
let mod_exp_vartime_precomp len k a bBits b res =
let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_vt_precomp k a bBits b res
false
Effects.Def.fst
Effects.Def.exnst_laws
val exnst_laws : Prims.unit
let exnst_laws = monad_laws_via_eq exnst eq_exnst return_exnst bind_exnst
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 73, "end_line": 168, "start_col": 0, "start_line": 168 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1) let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn (* ******************************************************************************) (* Effect (exnst a) : A combined monad, state over exceptions *) (* ******************************************************************************) let exnst (a:Type) = restricted_t s (fun _ -> (option (a * s))) let eq_exnst (a:Type) (x:exnst a) (y:exnst a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_exnst (a:Type) (x:a) : exnst a = on_dom s (fun s -> Some (x, s)) let bind_exnst (a:Type) (b:Type) (f:exnst a) (g: a -> Tot (exnst b)) : exnst b = on_dom s (fun s0 -> match f s0 with | None -> None | Some (x, s1) -> g x s1)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.monad_laws_via_eq", "Effects.Def.exnst", "Effects.Def.eq_exnst", "Effects.Def.return_exnst", "Effects.Def.bind_exnst" ]
[]
false
false
false
true
false
let exnst_laws =
monad_laws_via_eq exnst eq_exnst return_exnst bind_exnst
false
Effects.Def.fst
Effects.Def.morphism_lift_ex_exnst
val morphism_lift_ex_exnst : Prims.unit
let morphism_lift_ex_exnst = morphism_laws_via_eq ex exnst eq_exnst return_ex bind_ex return_exnst bind_exnst lift_ex_exnst
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 22, "end_line": 222, "start_col": 0, "start_line": 218 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1) let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn (* ******************************************************************************) (* Effect (exnst a) : A combined monad, state over exceptions *) (* ******************************************************************************) let exnst (a:Type) = restricted_t s (fun _ -> (option (a * s))) let eq_exnst (a:Type) (x:exnst a) (y:exnst a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_exnst (a:Type) (x:a) : exnst a = on_dom s (fun s -> Some (x, s)) let bind_exnst (a:Type) (b:Type) (f:exnst a) (g: a -> Tot (exnst b)) : exnst b = on_dom s (fun s0 -> match f s0 with | None -> None | Some (x, s1) -> g x s1) let exnst_laws = monad_laws_via_eq exnst eq_exnst return_exnst bind_exnst (* ******************************************************************************) (* Morphism: st -> stexn *) (* ******************************************************************************) let lift_st_stexn (a:Type) (f:st a) : stexn a = on_dom s (fun s0 -> let x, s1 = f s0 in Some x, s1) let morphism_lift_st_exn = morphism_laws_via_eq st stexn eq_stexn return_st bind_st return_stexn bind_stexn lift_st_stexn (* ******************************************************************************) (* Morphism: exn -> stexn *) (* ******************************************************************************) let lift_ex_stexn (a:Type) (f:ex a) : stexn a = on_dom s (fun s0 -> f (), s0) let morphism_lift_ex_stexn = morphism_laws_via_eq ex stexn eq_stexn return_ex bind_ex return_stexn bind_stexn lift_ex_stexn (* ******************************************************************************) (* Morphism: st -> exnst *) (* ******************************************************************************) let lift_st_exnst (a:Type) (f:st a) : exnst a = on_dom s (fun s0 -> Some (f s0)) let morphism_lift_st_exnst = morphism_laws_via_eq st exnst eq_exnst return_st bind_st return_exnst bind_exnst lift_st_exnst (* ******************************************************************************) (* Morphism: ex -> exnst *) (* ******************************************************************************) let lift_ex_exnst (a:Type) (f:ex a) : exnst a = on_dom s (fun s0 -> match f () with | None -> None | Some x -> Some (x, s0))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.morphism_laws_via_eq", "Effects.Def.ex", "Effects.Def.exnst", "Effects.Def.eq_exnst", "Effects.Def.return_ex", "Effects.Def.bind_ex", "Effects.Def.return_exnst", "Effects.Def.bind_exnst", "Effects.Def.lift_ex_exnst" ]
[]
false
false
false
true
false
let morphism_lift_ex_exnst =
morphism_laws_via_eq ex exnst eq_exnst return_ex bind_ex return_exnst bind_exnst lift_ex_exnst
false
Hacl.Bignum64.fst
Hacl.Bignum64.bn_to_bytes_le
val bn_to_bytes_le: len:_ -> Hacl.Bignum.Convert.bn_to_bytes_le_st t_limbs len
val bn_to_bytes_le: len:_ -> Hacl.Bignum.Convert.bn_to_bytes_le_st t_limbs len
let bn_to_bytes_le len b res = Hacl.Bignum.Convert.mk_bn_to_bytes_le false len b res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 55, "end_line": 90, "start_col": 0, "start_line": 89 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len) let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res let mod_exp_vartime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_vt n a bBits b res let mod_exp_consttime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res let mod_inv_prime_vartime len n a res = BS.mk_bn_mod_inv_prime_safe len (ke len).BE.exp_vt n a res let mont_ctx_init len r n = MA.bn_field_init len (ke len).BE.precompr2 r n let mont_ctx_free k = MA.bn_field_free k let mod_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.bn_mod_ctx len (bn_slow_precomp len1) k a res let mod_exp_vartime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_vt_precomp k a bBits b res let mod_exp_consttime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_ct_precomp k a bBits b res let mod_inv_prime_vartime_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_inv_prime_ctx len (BI.mk_bn_mod_inv_prime_precomp len1 (ke len1).BE.exp_vt_precomp) k a res let new_bn_from_bytes_be r len b = BS.new_bn_from_bytes_be r len b let new_bn_from_bytes_le r len b = BS.new_bn_from_bytes_le r len b let bn_to_bytes_be len b res = Hacl.Bignum.Convert.mk_bn_to_bytes_be false len b res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: Lib.IntTypes.size_t { 0 < Lib.IntTypes.v len /\ Lib.IntTypes.numbytes Hacl.Bignum64.t_limbs * Lib.IntTypes.v (Hacl.Bignum.Definitions.blocks len (Lib.IntTypes.size (Lib.IntTypes.numbytes Hacl.Bignum64.t_limbs))) <= Lib.IntTypes.max_size_t } -> Hacl.Bignum.Convert.bn_to_bytes_le_st Hacl.Bignum64.t_limbs len
Prims.Tot
[ "total" ]
[]
[ "Lib.IntTypes.size_t", "Prims.l_and", "Prims.b2t", "Prims.op_LessThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.numbytes", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.Definitions.blocks", "Lib.IntTypes.size", "Lib.IntTypes.max_size_t", "Hacl.Bignum.Definitions.lbignum", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "Hacl.Bignum.Convert.mk_bn_to_bytes_le", "Prims.unit" ]
[]
false
false
false
false
false
let bn_to_bytes_le len b res =
Hacl.Bignum.Convert.mk_bn_to_bytes_le false len b res
false
Effects.Def.fst
Effects.Def.morphism_lift_st_exnst
val morphism_lift_st_exnst : Prims.unit
let morphism_lift_st_exnst = morphism_laws_via_eq st exnst eq_exnst return_st bind_st return_exnst bind_exnst lift_st_exnst
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 22, "end_line": 207, "start_col": 0, "start_line": 203 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1) let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn (* ******************************************************************************) (* Effect (exnst a) : A combined monad, state over exceptions *) (* ******************************************************************************) let exnst (a:Type) = restricted_t s (fun _ -> (option (a * s))) let eq_exnst (a:Type) (x:exnst a) (y:exnst a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_exnst (a:Type) (x:a) : exnst a = on_dom s (fun s -> Some (x, s)) let bind_exnst (a:Type) (b:Type) (f:exnst a) (g: a -> Tot (exnst b)) : exnst b = on_dom s (fun s0 -> match f s0 with | None -> None | Some (x, s1) -> g x s1) let exnst_laws = monad_laws_via_eq exnst eq_exnst return_exnst bind_exnst (* ******************************************************************************) (* Morphism: st -> stexn *) (* ******************************************************************************) let lift_st_stexn (a:Type) (f:st a) : stexn a = on_dom s (fun s0 -> let x, s1 = f s0 in Some x, s1) let morphism_lift_st_exn = morphism_laws_via_eq st stexn eq_stexn return_st bind_st return_stexn bind_stexn lift_st_stexn (* ******************************************************************************) (* Morphism: exn -> stexn *) (* ******************************************************************************) let lift_ex_stexn (a:Type) (f:ex a) : stexn a = on_dom s (fun s0 -> f (), s0) let morphism_lift_ex_stexn = morphism_laws_via_eq ex stexn eq_stexn return_ex bind_ex return_stexn bind_stexn lift_ex_stexn (* ******************************************************************************) (* Morphism: st -> exnst *) (* ******************************************************************************) let lift_st_exnst (a:Type) (f:st a) : exnst a = on_dom s (fun s0 -> Some (f s0))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.morphism_laws_via_eq", "Effects.Def.st", "Effects.Def.exnst", "Effects.Def.eq_exnst", "Effects.Def.return_st", "Effects.Def.bind_st", "Effects.Def.return_exnst", "Effects.Def.bind_exnst", "Effects.Def.lift_st_exnst" ]
[]
false
false
false
true
false
let morphism_lift_st_exnst =
morphism_laws_via_eq st exnst eq_exnst return_st bind_st return_exnst bind_exnst lift_st_exnst
false
Hacl.Impl.Poly1305.fst
Hacl.Impl.Poly1305.poly1305_update_multi
val poly1305_update_multi: #s:field_spec -> len:size_t{0 < v len /\ v len % v (blocklen s) == 0} -> text:lbuffer uint8 len -> pre:precomp_r s -> acc:felem s -> Stack unit (requires fun h -> live h pre /\ live h acc /\ live h text /\ disjoint acc text /\ disjoint acc pre /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.load_precompute_r_post #(width s) h pre) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == Vec.poly1305_update_multi #(width s) (as_seq h0 text) (feval h0 acc).[0] (feval h0 (gsub pre 0ul 5ul)).[0])
val poly1305_update_multi: #s:field_spec -> len:size_t{0 < v len /\ v len % v (blocklen s) == 0} -> text:lbuffer uint8 len -> pre:precomp_r s -> acc:felem s -> Stack unit (requires fun h -> live h pre /\ live h acc /\ live h text /\ disjoint acc text /\ disjoint acc pre /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.load_precompute_r_post #(width s) h pre) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == Vec.poly1305_update_multi #(width s) (as_seq h0 text) (feval h0 acc).[0] (feval h0 (gsub pre 0ul 5ul)).[0])
let poly1305_update_multi #s len text pre acc = let h0 = ST.get () in assert_norm (v 10ul + v 5ul <= v 20ul); assert (feval h0 (gsub pre 10ul 5ul) == Vec.compute_rw #(width s) ((feval h0 (gsub pre 0ul 5ul)).[0])); let bs = blocklen s in //assert (v bs == width s * S.size_block); let text0 = sub text 0ul bs in load_acc #s acc text0; let len1 = len -! bs in let text1 = sub text bs len1 in poly1305_update_multi_loop #s bs len1 text1 pre acc; fmul_rn_normalize acc pre
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 27, "end_line": 524, "start_col": 0, "start_line": 511 }
module Hacl.Impl.Poly1305 open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Poly1305.Fields open Hacl.Impl.Poly1305.Bignum128 module ST = FStar.HyperStack.ST module BSeq = Lib.ByteSequence module LSeq = Lib.Sequence module S = Spec.Poly1305 module Vec = Hacl.Spec.Poly1305.Vec module Equiv = Hacl.Spec.Poly1305.Equiv module F32xN = Hacl.Impl.Poly1305.Field32xN friend Lib.LoopCombinators let _: squash (inversion field_spec) = allow_inversion field_spec #reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let get_acc #s (ctx:poly1305_ctx s) : Stack (felem s) (requires fun h -> live h ctx) (ensures fun h0 acc h1 -> h0 == h1 /\ live h1 acc /\ acc == gsub ctx 0ul (nlimb s)) = sub ctx 0ul (nlimb s) inline_for_extraction noextract let get_precomp_r #s (ctx:poly1305_ctx s) : Stack (precomp_r s) (requires fun h -> live h ctx) (ensures fun h0 pre h1 -> h0 == h1 /\ live h1 pre /\ pre == gsub ctx (nlimb s) (precomplen s)) = sub ctx (nlimb s) (precomplen s) unfold let op_String_Access #a #len = LSeq.index #a #len let as_get_acc #s h ctx = (feval h (gsub ctx 0ul (nlimb s))).[0] let as_get_r #s h ctx = (feval h (gsub ctx (nlimb s) (nlimb s))).[0] let state_inv_t #s h ctx = felem_fits h (gsub ctx 0ul (nlimb s)) (2, 2, 2, 2, 2) /\ F32xN.load_precompute_r_post #(width s) h (gsub ctx (nlimb s) (precomplen s)) #reset-options "--z3rlimit 100 --max_fuel 0 --max_ifuel 0 --record_options" let reveal_ctx_inv' #s ctx ctx' h0 h1 = let acc_b = gsub ctx 0ul (nlimb s) in let acc_b' = gsub ctx' 0ul (nlimb s) in let r_b = gsub ctx (nlimb s) (nlimb s) in let r_b' = gsub ctx' (nlimb s) (nlimb s) in let precom_b = gsub ctx (nlimb s) (precomplen s) in let precom_b' = gsub ctx' (nlimb s) (precomplen s) in as_seq_gsub h0 ctx 0ul (nlimb s); as_seq_gsub h1 ctx 0ul (nlimb s); as_seq_gsub h0 ctx (nlimb s) (nlimb s); as_seq_gsub h1 ctx (nlimb s) (nlimb s); as_seq_gsub h0 ctx (nlimb s) (precomplen s); as_seq_gsub h1 ctx (nlimb s) (precomplen s); as_seq_gsub h0 ctx' 0ul (nlimb s); as_seq_gsub h1 ctx' 0ul (nlimb s); as_seq_gsub h0 ctx' (nlimb s) (nlimb s); as_seq_gsub h1 ctx' (nlimb s) (nlimb s); as_seq_gsub h0 ctx' (nlimb s) (precomplen s); as_seq_gsub h1 ctx' (nlimb s) (precomplen s); assert (as_seq h0 acc_b == as_seq h1 acc_b'); assert (as_seq h0 r_b == as_seq h1 r_b'); assert (as_seq h0 precom_b == as_seq h1 precom_b') val fmul_precomp_inv_zeros: #s:field_spec -> precomp_b:lbuffer (limb s) (precomplen s) -> h:mem -> Lemma (requires as_seq h precomp_b == Lib.Sequence.create (v (precomplen s)) (limb_zero s)) (ensures F32xN.fmul_precomp_r_pre #(width s) h precomp_b) let fmul_precomp_inv_zeros #s precomp_b h = let r_b = gsub precomp_b 0ul (nlimb s) in let r_b5 = gsub precomp_b (nlimb s) (nlimb s) in as_seq_gsub h precomp_b 0ul (nlimb s); as_seq_gsub h precomp_b (nlimb s) (nlimb s); Hacl.Spec.Poly1305.Field32xN.Lemmas.precomp_r5_zeros (width s); LSeq.eq_intro (feval h r_b) (LSeq.create (width s) 0); LSeq.eq_intro (feval h r_b5) (LSeq.create (width s) 0); assert (F32xN.as_tup5 #(width s) h r_b5 == F32xN.precomp_r5 (F32xN.as_tup5 h r_b)) val precomp_inv_zeros: #s:field_spec -> precomp_b:lbuffer (limb s) (precomplen s) -> h:mem -> Lemma (requires as_seq h precomp_b == Lib.Sequence.create (v (precomplen s)) (limb_zero s)) (ensures F32xN.load_precompute_r_post #(width s) h precomp_b) #push-options "--z3rlimit 150" let precomp_inv_zeros #s precomp_b h = let r_b = gsub precomp_b 0ul (nlimb s) in let rn_b = gsub precomp_b (2ul *! nlimb s) (nlimb s) in let rn_b5 = gsub precomp_b (3ul *! nlimb s) (nlimb s) in as_seq_gsub h precomp_b 0ul (nlimb s); as_seq_gsub h precomp_b (2ul *! nlimb s) (nlimb s); as_seq_gsub h precomp_b (3ul *! nlimb s) (nlimb s); fmul_precomp_inv_zeros #s precomp_b h; Hacl.Spec.Poly1305.Field32xN.Lemmas.precomp_r5_zeros (width s); LSeq.eq_intro (feval h r_b) (LSeq.create (width s) 0); LSeq.eq_intro (feval h rn_b) (LSeq.create (width s) 0); LSeq.eq_intro (feval h rn_b5) (LSeq.create (width s) 0); assert (F32xN.as_tup5 #(width s) h rn_b5 == F32xN.precomp_r5 (F32xN.as_tup5 h rn_b)); assert (feval h rn_b == Vec.compute_rw (feval h r_b).[0]) #pop-options let ctx_inv_zeros #s ctx h = // ctx = [acc_b; r_b; r_b5; rn_b; rn_b5] let acc_b = gsub ctx 0ul (nlimb s) in as_seq_gsub h ctx 0ul (nlimb s); LSeq.eq_intro (feval h acc_b) (LSeq.create (width s) 0); assert (felem_fits h acc_b (2, 2, 2, 2, 2)); let precomp_b = gsub ctx (nlimb s) (precomplen s) in LSeq.eq_intro (as_seq h precomp_b) (Lib.Sequence.create (v (precomplen s)) (limb_zero s)); precomp_inv_zeros #s precomp_b h #reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract val poly1305_encode_block: #s:field_spec -> f:felem s -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (feval h1 f).[0] == S.encode 16 (as_seq h0 b)) let poly1305_encode_block #s f b = load_felem_le f b; set_bit128 f inline_for_extraction noextract val poly1305_encode_blocks: #s:field_spec -> f:felem s -> b:lbuffer uint8 (blocklen s) -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == Vec.load_blocks #(width s) (as_seq h0 b)) let poly1305_encode_blocks #s f b = load_felems_le f b; set_bit128 f inline_for_extraction noextract val poly1305_encode_last: #s:field_spec -> f:felem s -> len:size_t{v len < 16} -> b:lbuffer uint8 len -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (feval h1 f).[0] == S.encode (v len) (as_seq h0 b)) let poly1305_encode_last #s f len b = push_frame(); let tmp = create 16ul (u8 0) in update_sub tmp 0ul len b; let h0 = ST.get () in Hacl.Impl.Poly1305.Lemmas.nat_from_bytes_le_eq_lemma (v len) (as_seq h0 b); assert (BSeq.nat_from_bytes_le (as_seq h0 b) == BSeq.nat_from_bytes_le (as_seq h0 tmp)); assert (BSeq.nat_from_bytes_le (as_seq h0 b) < pow2 (v len * 8)); load_felem_le f tmp; let h1 = ST.get () in lemma_feval_is_fas_nat h1 f; set_bit f (len *! 8ul); pop_frame() inline_for_extraction noextract val poly1305_encode_r: #s:field_spec -> p:precomp_r s -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h b /\ live h p /\ disjoint b p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ F32xN.load_precompute_r_post #(width s) h1 p /\ (feval h1 (gsub p 0ul 5ul)).[0] == S.poly1305_encode_r (as_seq h0 b)) let poly1305_encode_r #s p b = let lo = uint_from_bytes_le (sub b 0ul 8ul) in let hi = uint_from_bytes_le (sub b 8ul 8ul) in let mask0 = u64 0x0ffffffc0fffffff in let mask1 = u64 0x0ffffffc0ffffffc in let lo = lo &. mask0 in let hi = hi &. mask1 in load_precompute_r p lo hi [@ Meta.Attribute.specialize ] let poly1305_init #s ctx key = let acc = get_acc ctx in let pre = get_precomp_r ctx in let kr = sub key 0ul 16ul in set_zero acc; poly1305_encode_r #s pre kr inline_for_extraction noextract val update1: #s:field_spec -> p:precomp_r s -> b:lbuffer uint8 16ul -> acc:felem s -> Stack unit (requires fun h -> live h p /\ live h b /\ live h acc /\ disjoint p acc /\ disjoint b acc /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.fmul_precomp_r_pre #(width s) h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == S.poly1305_update1 (feval h0 (gsub p 0ul 5ul)).[0] 16 (as_seq h0 b) (feval h0 acc).[0]) let update1 #s pre b acc = push_frame (); let e = create (nlimb s) (limb_zero s) in poly1305_encode_block e b; fadd_mul_r acc e pre; pop_frame () let poly1305_update1 #s ctx text = let pre = get_precomp_r ctx in let acc = get_acc ctx in update1 pre text acc inline_for_extraction noextract val poly1305_update_last: #s:field_spec -> p:precomp_r s -> len:size_t{v len < 16} -> b:lbuffer uint8 len -> acc:felem s -> Stack unit (requires fun h -> live h p /\ live h b /\ live h acc /\ disjoint p acc /\ disjoint b acc /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.fmul_precomp_r_pre #(width s) h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == S.poly1305_update1 (feval h0 (gsub p 0ul 5ul)).[0] (v len) (as_seq h0 b) (feval h0 acc).[0]) #push-options "--z3rlimit 200" let poly1305_update_last #s pre len b acc = push_frame (); let e = create (nlimb s) (limb_zero s) in poly1305_encode_last e len b; fadd_mul_r acc e pre; pop_frame () #pop-options inline_for_extraction noextract val poly1305_update_nblocks: #s:field_spec -> p:precomp_r s -> b:lbuffer uint8 (blocklen s) -> acc:felem s -> Stack unit (requires fun h -> live h p /\ live h b /\ live h acc /\ disjoint acc p /\ disjoint acc b /\ felem_fits h acc (3, 3, 3, 3, 3) /\ F32xN.load_precompute_r_post #(width s) h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (3, 3, 3, 3, 3) /\ feval h1 acc == Vec.poly1305_update_nblocks #(width s) (feval h0 (gsub p 10ul 5ul)) (as_seq h0 b) (feval h0 acc)) let poly1305_update_nblocks #s pre b acc = push_frame (); let e = create (nlimb s) (limb_zero s) in poly1305_encode_blocks e b; fmul_rn acc acc pre; fadd acc acc e; pop_frame () inline_for_extraction noextract val poly1305_update1_f: #s:field_spec -> p:precomp_r s -> nb:size_t -> len:size_t{v nb == v len / 16} -> text:lbuffer uint8 len -> i:size_t{v i < v nb} -> acc:felem s -> Stack unit (requires fun h -> live h p /\ live h text /\ live h acc /\ disjoint acc p /\ disjoint acc text /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.fmul_precomp_r_pre #(width s) h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == LSeq.repeat_blocks_f #uint8 #S.felem 16 (as_seq h0 text) (S.poly1305_update1 (feval h0 (gsub p 0ul 5ul)).[0] 16) (v nb) (v i) (feval h0 acc).[0]) let poly1305_update1_f #s pre nb len text i acc= assert ((v i + 1) * 16 <= v nb * 16); let block = sub #_ #_ #len text (i *! 16ul) 16ul in update1 #s pre block acc #push-options "--z3rlimit 100 --max_fuel 1" inline_for_extraction noextract val poly1305_update_scalar: #s:field_spec -> len:size_t -> text:lbuffer uint8 len -> pre:precomp_r s -> acc:felem s -> Stack unit (requires fun h -> live h text /\ live h acc /\ live h pre /\ disjoint acc text /\ disjoint acc pre /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.fmul_precomp_r_pre #(width s) h pre) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == S.poly1305_update (as_seq h0 text) (feval h0 acc).[0] (feval h0 (gsub pre 0ul 5ul)).[0]) let poly1305_update_scalar #s len text pre acc = let nb = len /. 16ul in let rem = len %. 16ul in let h0 = ST.get () in LSeq.lemma_repeat_blocks #uint8 #S.felem 16 (as_seq h0 text) (S.poly1305_update1 (feval h0 (gsub pre 0ul 5ul)).[0] 16) (S.poly1305_update_last (feval h0 (gsub pre 0ul 5ul)).[0]) (feval h0 acc).[0]; [@ inline_let] let spec_fh h0 = LSeq.repeat_blocks_f 16 (as_seq h0 text) (S.poly1305_update1 (feval h0 (gsub pre 0ul 5ul)).[0] 16) (v nb) in [@ inline_let] let inv h (i:nat{i <= v nb}) = modifies1 acc h0 h /\ live h pre /\ live h text /\ live h acc /\ disjoint acc pre /\ disjoint acc text /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.fmul_precomp_r_pre #(width s) h pre /\ (feval h acc).[0] == Lib.LoopCombinators.repeati i (spec_fh h0) (feval h0 acc).[0] in Lib.Loops.for (size 0) nb inv (fun i -> Lib.LoopCombinators.unfold_repeati (v nb) (spec_fh h0) (feval h0 acc).[0] (v i); poly1305_update1_f #s pre nb len text i acc); let h1 = ST.get () in assert ((feval h1 acc).[0] == Lib.LoopCombinators.repeati (v nb) (spec_fh h0) (feval h0 acc).[0]); if rem >. 0ul then ( let last = sub text (nb *! 16ul) rem in as_seq_gsub h1 text (nb *! 16ul) rem; assert (disjoint acc last); poly1305_update_last #s pre rem last acc) #pop-options inline_for_extraction noextract val poly1305_update_multi_f: #s:field_spec -> p:precomp_r s -> bs:size_t{v bs == width s * S.size_block} -> nb:size_t -> len:size_t{v nb == v len / v bs /\ v len % v bs == 0} -> text:lbuffer uint8 len -> i:size_t{v i < v nb} -> acc:felem s -> Stack unit (requires fun h -> live h p /\ live h text /\ live h acc /\ disjoint acc p /\ disjoint acc text /\ felem_fits h acc (3, 3, 3, 3, 3) /\ F32xN.load_precompute_r_post #(width s) h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (3, 3, 3, 3, 3) /\ F32xN.load_precompute_r_post #(width s) h1 p /\ feval h1 acc == LSeq.repeat_blocks_f #uint8 #(Vec.elem (width s)) (v bs) (as_seq h0 text) (Vec.poly1305_update_nblocks #(width s) (feval h0 (gsub p 10ul 5ul))) (v nb) (v i) (feval h0 acc)) let poly1305_update_multi_f #s pre bs nb len text i acc= assert ((v i + 1) * v bs <= v nb * v bs); let block = sub #_ #_ #len text (i *! bs) bs in let h1 = ST.get () in as_seq_gsub h1 text (i *! bs) bs; poly1305_update_nblocks #s pre block acc #push-options "--max_fuel 1" inline_for_extraction noextract val poly1305_update_multi_loop: #s:field_spec -> bs:size_t{v bs == width s * S.size_block} -> len:size_t{v len % v (blocklen s) == 0} -> text:lbuffer uint8 len -> pre:precomp_r s -> acc:felem s -> Stack unit (requires fun h -> live h pre /\ live h acc /\ live h text /\ disjoint acc text /\ disjoint acc pre /\ felem_fits h acc (3, 3, 3, 3, 3) /\ F32xN.load_precompute_r_post #(width s) h pre) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (3, 3, 3, 3, 3) /\ F32xN.load_precompute_r_post #(width s) h1 pre /\ feval h1 acc == LSeq.repeat_blocks_multi #uint8 #(Vec.elem (width s)) (v bs) (as_seq h0 text) (Vec.poly1305_update_nblocks (feval h0 (gsub pre 10ul 5ul))) (feval h0 acc)) let poly1305_update_multi_loop #s bs len text pre acc = let nb = len /. bs in let h0 = ST.get () in LSeq.lemma_repeat_blocks_multi #uint8 #(Vec.elem (width s)) (v bs) (as_seq h0 text) (Vec.poly1305_update_nblocks #(width s) (feval h0 (gsub pre 10ul 5ul))) (feval h0 acc); [@ inline_let] let spec_fh h0 = LSeq.repeat_blocks_f (v bs) (as_seq h0 text) (Vec.poly1305_update_nblocks #(width s) (feval h0 (gsub pre 10ul 5ul))) (v nb) in [@ inline_let] let inv h (i:nat{i <= v nb}) = modifies1 acc h0 h /\ live h pre /\ live h text /\ live h acc /\ disjoint acc pre /\ disjoint acc text /\ felem_fits h acc (3, 3, 3, 3, 3) /\ F32xN.load_precompute_r_post #(width s) h pre /\ feval h acc == Lib.LoopCombinators.repeati i (spec_fh h0) (feval h0 acc) in Lib.Loops.for (size 0) nb inv (fun i -> Lib.LoopCombinators.unfold_repeati (v nb) (spec_fh h0) (feval h0 acc) (v i); poly1305_update_multi_f #s pre bs nb len text i acc) #pop-options #push-options "--z3rlimit 350" inline_for_extraction noextract val poly1305_update_multi: #s:field_spec -> len:size_t{0 < v len /\ v len % v (blocklen s) == 0} -> text:lbuffer uint8 len -> pre:precomp_r s -> acc:felem s -> Stack unit (requires fun h -> live h pre /\ live h acc /\ live h text /\ disjoint acc text /\ disjoint acc pre /\ felem_fits h acc (2, 2, 2, 2, 2) /\ F32xN.load_precompute_r_post #(width s) h pre) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (2, 2, 2, 2, 2) /\ (feval h1 acc).[0] == Vec.poly1305_update_multi #(width s) (as_seq h0 text) (feval h0 acc).[0] (feval h0 (gsub pre 0ul 5ul)).[0])
{ "checked_file": "/", "dependencies": [ "Spec.Poly1305.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.Sequence.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Equiv.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "Hacl.Impl.Poly1305.Fields.fst.checked", "Hacl.Impl.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Bignum128.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": true, "source_file": "Hacl.Impl.Poly1305.fst" }
[ { "abbrev": true, "full_module": "Hacl.Impl.Poly1305.Field32xN", "short_module": "F32xN" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Equiv", "short_module": "Equiv" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": true, "full_module": "Spec.Poly1305", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Bignum128", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": true, "full_module": "Spec.Poly1305", "short_module": "S" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Fields", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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": [], "z3refresh": false, "z3rlimit": 350, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
len: Lib.IntTypes.size_t { 0 < Lib.IntTypes.v len /\ Lib.IntTypes.v len % Lib.IntTypes.v (Hacl.Impl.Poly1305.Fields.blocklen s) == 0 } -> text: Lib.Buffer.lbuffer Lib.IntTypes.uint8 len -> pre: Hacl.Impl.Poly1305.Fields.precomp_r s -> acc: Hacl.Impl.Poly1305.Fields.felem s -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Poly1305.Fields.field_spec", "Lib.IntTypes.size_t", "Prims.l_and", "Prims.b2t", "Prims.op_LessThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.eq2", "Prims.int", "Prims.op_Modulus", "Hacl.Impl.Poly1305.Fields.blocklen", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "Hacl.Impl.Poly1305.Fields.precomp_r", "Hacl.Impl.Poly1305.Fields.felem", "Hacl.Impl.Poly1305.Fields.fmul_rn_normalize", "Prims.unit", "Hacl.Impl.Poly1305.poly1305_update_multi_loop", "Lib.Buffer.lbuffer_t", "Lib.Buffer.MUT", "Lib.IntTypes.int_t", "Lib.IntTypes.U8", "Lib.IntTypes.SEC", "Lib.Buffer.sub", "Lib.IntTypes.op_Subtraction_Bang", "Hacl.Impl.Poly1305.Fields.load_acc", "FStar.UInt32.__uint_to_t", "Prims.op_Multiply", "Spec.Poly1305.size_block", "Prims._assert", "Lib.Sequence.lseq", "Spec.Poly1305.felem", "Hacl.Impl.Poly1305.Fields.width", "Hacl.Impl.Poly1305.Fields.feval", "Lib.Buffer.gsub", "Hacl.Impl.Poly1305.Fields.limb", "Hacl.Impl.Poly1305.Fields.precomplen", "Hacl.Spec.Poly1305.Vec.compute_rw", "Hacl.Impl.Poly1305.op_String_Access", "FStar.Pervasives.assert_norm", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get" ]
[]
false
true
false
false
false
let poly1305_update_multi #s len text pre acc =
let h0 = ST.get () in assert_norm (v 10ul + v 5ul <= v 20ul); assert (feval h0 (gsub pre 10ul 5ul) == Vec.compute_rw #(width s) ((feval h0 (gsub pre 0ul 5ul)).[ 0 ])); let bs = blocklen s in let text0 = sub text 0ul bs in load_acc #s acc text0; let len1 = len -! bs in let text1 = sub text bs len1 in poly1305_update_multi_loop #s bs len1 text1 pre acc; fmul_rn_normalize acc pre
false
FStar.Class.TotalOrder.Raw.fst
FStar.Class.TotalOrder.Raw.totalorder_list
[@@ FStar.Tactics.Typeclasses.tcinstance] val totalorder_list (#a: _) (d: totalorder a) : totalorder (list a)
[@@ FStar.Tactics.Typeclasses.tcinstance] val totalorder_list (#a: _) (d: totalorder a) : totalorder (list a)
instance totalorder_list #a (d : totalorder a) : totalorder (list a) = { compare = raw_compare_lists d; }
{ "file_name": "ulib/FStar.Class.TotalOrder.Raw.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 1, "end_line": 88, "start_col": 0, "start_line": 86 }
(* Copyright 2008-2018 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 FStar.Class.TotalOrder.Raw open FStar.Order let flip = function | Lt -> Gt | Eq -> Eq | Gt -> Lt let raw_comparator (a:Type) = a -> a -> order class totalorder (a:Type) = { compare : raw_comparator a; } val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<) x y = compare x y = Lt val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>) x y = compare x y = Gt val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (=) x y = compare x y = Eq val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<=) x y = compare x y <> Gt val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>=) x y = compare x y <> Lt val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<>) x y = compare x y <> Eq instance _ : totalorder int = { compare = Order.compare_int; } instance _ : totalorder bool = { compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt); } (* Lex order on tuples *) instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = { compare = (fun (xa,xb) (ya, yb) -> match compare xa ya with | Lt -> Lt | Gt -> Gt | Eq -> compare xb yb); } instance totalorder_option #a (d : totalorder a) : totalorder (option a) = { compare = (fun o1 o2 -> match o1, o2 with | None, None -> Eq | None, Some _ -> Lt | Some _, None -> Gt | Some a1, Some a2 -> compare a1 a2); } let rec raw_compare_lists #a (d : totalorder a) : raw_comparator (list a) = fun l1 l2 -> match l1, l2 with | [], [] -> Eq | [], _::_ -> Lt | _::_, [] -> Gt | x::xs, y::ys -> match compare x y with | Lt -> Lt | Gt -> Gt | Eq -> raw_compare_lists d xs ys
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Tactics.Typeclasses.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Order.fst.checked" ], "interface_file": false, "source_file": "FStar.Class.TotalOrder.Raw.fst" }
[ { "abbrev": false, "full_module": "FStar.Order", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "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
d: FStar.Class.TotalOrder.Raw.totalorder a -> FStar.Class.TotalOrder.Raw.totalorder (Prims.list a)
Prims.Tot
[ "total" ]
[]
[ "FStar.Class.TotalOrder.Raw.totalorder", "FStar.Class.TotalOrder.Raw.Mktotalorder", "Prims.list", "FStar.Class.TotalOrder.Raw.raw_compare_lists" ]
[]
false
false
false
true
false
[@@ FStar.Tactics.Typeclasses.tcinstance] let totalorder_list #a (d: totalorder a) : totalorder (list a) =
{ compare = raw_compare_lists d }
false
Effects.Def.fst
Effects.Def.morphism_lift_st_exn
val morphism_lift_st_exn : Prims.unit
let morphism_lift_st_exn = morphism_laws_via_eq st stexn eq_stexn return_st bind_st return_stexn bind_stexn lift_st_stexn
{ "file_name": "examples/dm4free/Effects.Def.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 22, "end_line": 181, "start_col": 0, "start_line": 177 }
(* Copyright 2008-2018 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. *) (* This module defines 4 monads arranged in a partial order stexn ^ ^ / \ st exn \ / v v exnst Proving the monad laws for each point and the morphism laws for each edge. *) module Effects.Def open FStar.FunctionalExtensionality //proving the laws requires feq //A generic template for proving the monad laws, via some equivalence relation eq_m let eq_m (m:Type -> Type) = eq:(a:Type -> m a -> m a -> Type){forall a x y. eq a x y ==> x == y} let eq_m_aux (#m : Type->Type) (e : eq_m m) (#a : Type) (x y : m a) : Lemma (requires (e _ x y)) (ensures (x == y)) = () val monad_laws_via_eq: m:(Type -> Type) -> eq:eq_m m -> return:(a:Type -> x:a -> Tot (m a)) -> bind:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> Lemma (requires (forall (a:Type) (f:m a). eq a (bind a a f (return a)) f) /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). eq b (bind a b (return a x) f) (f x)) /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). eq c (bind a c f (fun x -> bind b c (g x) h)) (bind b c (bind a b f g) h))) (ensures (forall (a:Type) (f:m a). bind a a f (return a) == f) //right unit /\ (forall (a:Type) (b:Type) (x:a) (f:a -> Tot (m b)). bind a b (return a x) f == f x) //left unit /\ (forall (a:Type) (b:Type) (c:Type) (f:m a) (g:(a -> Tot (m b))) (h:(b -> Tot (m c))). //associativity bind a c f (fun x -> bind b c (g x) h) == bind b c (bind a b f g) h)) let monad_laws_via_eq m eq return bind = let lem (a:Type) (f:m a) : Lemma (bind a a f (return a) == f) [SMTPat (bind a a f (return a))] = assert (bind a a f (return a) `eq a` f); eq_m_aux eq (bind a a f (return a)) f; // GM: ^ Unsure why Z3 doesn't figure this out on its own // instead of needing this lemma call. That's the only // reason this inner lemma exists. assert (bind a a f (return a) == f) in () //A generic template for proving the monad morphism laws, via some equivalence relation eq_m val morphism_laws_via_eq: m:(Type -> Type) -> n:(Type -> Type) -> eq_n:eq_m n -> return_m:(a:Type -> x:a -> Tot (m a)) -> bind_m:(a:Type -> b:Type -> m a -> (a -> Tot (m b)) -> Tot (m b)) -> return_n:(a:Type -> x:a -> Tot (n a)) -> bind_n:(a:Type -> b:Type -> n a -> (a -> Tot (n b)) -> Tot (n b)) -> lift:(a:Type -> m a -> Tot (n a)) -> Lemma (requires (forall (a:Type) (x:a). eq_n a (lift a (return_m a x)) (return_n a x)) /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). eq_n b (lift b (bind_m a b f g)) (bind_n a b (lift a f) (fun x -> lift b (g x))))) (ensures (forall (a:Type) (x:a). lift a (return_m a x) == return_n a x) //lift-unit /\ (forall (a:Type) (b:Type) (f:m a) (g: a -> Tot (m b)). lift b (bind_m a b f g) == bind_n a b (lift a f) (fun x -> lift b (g x)))) //lift-bind #set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0 --z3rlimit 100" let morphism_laws_via_eq m n eqn return_m bind_m return_n bind_n lift = () #reset-options (* ******************************************************************************) (* Effect (st a) : A state monad over an abstract state type s *) (* ******************************************************************************) assume type s : Type //an abstract type of the state let st (a:Type) = restricted_t s (fun _ -> a * s) let eq_st (a:Type) (x:st a) (y:st a) = is_restricted s x /\ is_restricted s y /\ feq x y //extensional equality on st let return_st (a:Type) (x:a) : st a = on_dom s (fun s -> (x, s)) let bind_st (a:Type) (b:Type) (f:st a) (g: a -> Tot (st b)) : st b = on_dom s (fun s0 -> let x, s1 = f s0 in g x s1) //Two actions: get and put let get (u:unit) : st s = on_dom s (fun s -> s, s) let put (x:s) : st unit = on_dom s (fun _ -> (), x) let st_laws = monad_laws_via_eq st eq_st return_st bind_st (* ******************************************************************************) (* Effect (ex a) : A state monad over an abstract state type s *) (* ******************************************************************************) let ex (a:Type) = restricted_t unit (fun _ -> option a) let eq_ex (a:Type) (x:ex a) (y:ex a) = is_restricted unit x /\ is_restricted unit y /\ feq x y //extensional equality on ex let return_ex (a:Type) (x:a) : ex a = on_dom unit (fun _ -> Some x) let bind_ex (a:Type) (b:Type) (f:ex a) (g: a -> Tot (ex b)) : ex b = on_dom unit (fun _ -> match f () with | None -> None | Some x -> g x ()) //one action: raise let raise_ (#a:Type) : ex a = on_dom unit (fun () -> None) //and a handler let handle (#a:Type) (f:ex a) (g:unit -> Tot a) : Tot a = match f () with | None -> g() | Some x -> x let ex_laws = monad_laws_via_eq ex eq_ex return_ex bind_ex (* ******************************************************************************) (* Effect (stexn a) : A combined monad, exceptions over state *) (* ******************************************************************************) let stexn (a:Type) = restricted_t s (fun _ -> (option a * s)) let eq_stexn (a:Type) (x:stexn a) (y:stexn a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_stexn (a:Type) (x:a) : stexn a = on_dom s (fun s -> Some x, s) let bind_stexn (a:Type) (b:Type) (f:stexn a) (g: a -> Tot (stexn b)) : stexn b = on_dom s (fun s0 -> match f s0 with | None, s1 -> None, s1 | Some x, s1 -> g x s1) let stexn_laws = monad_laws_via_eq stexn eq_stexn return_stexn bind_stexn (* ******************************************************************************) (* Effect (exnst a) : A combined monad, state over exceptions *) (* ******************************************************************************) let exnst (a:Type) = restricted_t s (fun _ -> (option (a * s))) let eq_exnst (a:Type) (x:exnst a) (y:exnst a) = is_restricted s x /\ is_restricted s y /\ feq x y let return_exnst (a:Type) (x:a) : exnst a = on_dom s (fun s -> Some (x, s)) let bind_exnst (a:Type) (b:Type) (f:exnst a) (g: a -> Tot (exnst b)) : exnst b = on_dom s (fun s0 -> match f s0 with | None -> None | Some (x, s1) -> g x s1) let exnst_laws = monad_laws_via_eq exnst eq_exnst return_exnst bind_exnst (* ******************************************************************************) (* Morphism: st -> stexn *) (* ******************************************************************************) let lift_st_stexn (a:Type) (f:st a) : stexn a = on_dom s (fun s0 -> let x, s1 = f s0 in Some x, s1)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": false, "source_file": "Effects.Def.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality //proving the laws requires feq", "short_module": null }, { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Effects", "short_module": null }, { "abbrev": false, "full_module": "Effects", "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
Prims.unit
Prims.Tot
[ "total" ]
[]
[ "Effects.Def.morphism_laws_via_eq", "Effects.Def.st", "Effects.Def.stexn", "Effects.Def.eq_stexn", "Effects.Def.return_st", "Effects.Def.bind_st", "Effects.Def.return_stexn", "Effects.Def.bind_stexn", "Effects.Def.lift_st_stexn" ]
[]
false
false
false
true
false
let morphism_lift_st_exn =
morphism_laws_via_eq st stexn eq_stexn return_st bind_st return_stexn bind_stexn lift_st_stexn
false
FStar.Class.TotalOrder.Raw.fst
FStar.Class.TotalOrder.Raw.flip
val flip : _: FStar.Order.order -> FStar.Order.order
let flip = function | Lt -> Gt | Eq -> Eq | Gt -> Lt
{ "file_name": "ulib/FStar.Class.TotalOrder.Raw.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 12, "end_line": 23, "start_col": 0, "start_line": 20 }
(* Copyright 2008-2018 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 FStar.Class.TotalOrder.Raw open FStar.Order
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Tactics.Typeclasses.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Order.fst.checked" ], "interface_file": false, "source_file": "FStar.Class.TotalOrder.Raw.fst" }
[ { "abbrev": false, "full_module": "FStar.Order", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "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
_: FStar.Order.order -> FStar.Order.order
Prims.Tot
[ "total" ]
[]
[ "FStar.Order.order", "FStar.Order.Gt", "FStar.Order.Eq", "FStar.Order.Lt" ]
[]
false
false
false
true
false
let flip =
function | Lt -> Gt | Eq -> Eq | Gt -> Lt
false
FStar.Class.TotalOrder.Raw.fst
FStar.Class.TotalOrder.Raw.totalorder_pair
[@@ FStar.Tactics.Typeclasses.tcinstance] val totalorder_pair (#a #b: _) (d1: totalorder a) (d2: totalorder b) : totalorder (a & b)
[@@ FStar.Tactics.Typeclasses.tcinstance] val totalorder_pair (#a #b: _) (d1: totalorder a) (d2: totalorder b) : totalorder (a & b)
instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = { compare = (fun (xa,xb) (ya, yb) -> match compare xa ya with | Lt -> Lt | Gt -> Gt | Eq -> compare xb yb); }
{ "file_name": "ulib/FStar.Class.TotalOrder.Raw.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 1, "end_line": 64, "start_col": 0, "start_line": 58 }
(* Copyright 2008-2018 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 FStar.Class.TotalOrder.Raw open FStar.Order let flip = function | Lt -> Gt | Eq -> Eq | Gt -> Lt let raw_comparator (a:Type) = a -> a -> order class totalorder (a:Type) = { compare : raw_comparator a; } val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<) x y = compare x y = Lt val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>) x y = compare x y = Gt val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (=) x y = compare x y = Eq val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<=) x y = compare x y <> Gt val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>=) x y = compare x y <> Lt val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<>) x y = compare x y <> Eq instance _ : totalorder int = { compare = Order.compare_int; } instance _ : totalorder bool = { compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt); }
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Tactics.Typeclasses.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Order.fst.checked" ], "interface_file": false, "source_file": "FStar.Class.TotalOrder.Raw.fst" }
[ { "abbrev": false, "full_module": "FStar.Order", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "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
d1: FStar.Class.TotalOrder.Raw.totalorder a -> d2: FStar.Class.TotalOrder.Raw.totalorder b -> FStar.Class.TotalOrder.Raw.totalorder (a * b)
Prims.Tot
[ "total" ]
[]
[ "FStar.Class.TotalOrder.Raw.totalorder", "FStar.Class.TotalOrder.Raw.Mktotalorder", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.Mktuple2", "FStar.Class.TotalOrder.Raw.compare", "FStar.Order.Lt", "FStar.Order.Gt", "FStar.Order.order" ]
[]
false
false
false
true
false
[@@ FStar.Tactics.Typeclasses.tcinstance] let totalorder_pair #a #b (d1: totalorder a) (d2: totalorder b) : totalorder (a & b) =
{ compare = (fun (xa, xb) (ya, yb) -> match compare xa ya with | Lt -> Lt | Gt -> Gt | Eq -> compare xb yb) }
false
FStar.Class.TotalOrder.Raw.fst
FStar.Class.TotalOrder.Raw.totalorder_option
[@@ FStar.Tactics.Typeclasses.tcinstance] val totalorder_option (#a: _) (d: totalorder a) : totalorder (option a)
[@@ FStar.Tactics.Typeclasses.tcinstance] val totalorder_option (#a: _) (d: totalorder a) : totalorder (option a)
instance totalorder_option #a (d : totalorder a) : totalorder (option a) = { compare = (fun o1 o2 -> match o1, o2 with | None, None -> Eq | None, Some _ -> Lt | Some _, None -> Gt | Some a1, Some a2 -> compare a1 a2); }
{ "file_name": "ulib/FStar.Class.TotalOrder.Raw.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 1, "end_line": 72, "start_col": 0, "start_line": 66 }
(* Copyright 2008-2018 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 FStar.Class.TotalOrder.Raw open FStar.Order let flip = function | Lt -> Gt | Eq -> Eq | Gt -> Lt let raw_comparator (a:Type) = a -> a -> order class totalorder (a:Type) = { compare : raw_comparator a; } val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<) x y = compare x y = Lt val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>) x y = compare x y = Gt val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (=) x y = compare x y = Eq val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<=) x y = compare x y <> Gt val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>=) x y = compare x y <> Lt val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<>) x y = compare x y <> Eq instance _ : totalorder int = { compare = Order.compare_int; } instance _ : totalorder bool = { compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt); } (* Lex order on tuples *) instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = { compare = (fun (xa,xb) (ya, yb) -> match compare xa ya with | Lt -> Lt | Gt -> Gt | Eq -> compare xb yb); }
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Tactics.Typeclasses.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Order.fst.checked" ], "interface_file": false, "source_file": "FStar.Class.TotalOrder.Raw.fst" }
[ { "abbrev": false, "full_module": "FStar.Order", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "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
d: FStar.Class.TotalOrder.Raw.totalorder a -> FStar.Class.TotalOrder.Raw.totalorder (FStar.Pervasives.Native.option a)
Prims.Tot
[ "total" ]
[]
[ "FStar.Class.TotalOrder.Raw.totalorder", "FStar.Class.TotalOrder.Raw.Mktotalorder", "FStar.Pervasives.Native.option", "FStar.Pervasives.Native.Mktuple2", "FStar.Order.Eq", "FStar.Order.Lt", "FStar.Order.Gt", "FStar.Class.TotalOrder.Raw.compare", "FStar.Order.order" ]
[]
false
false
false
true
false
[@@ FStar.Tactics.Typeclasses.tcinstance] let totalorder_option #a (d: totalorder a) : totalorder (option a) =
{ compare = (fun o1 o2 -> match o1, o2 with | None, None -> Eq | None, Some _ -> Lt | Some _, None -> Gt | Some a1, Some a2 -> compare a1 a2) }
false
FStar.Class.TotalOrder.Raw.fst
FStar.Class.TotalOrder.Raw.raw_compare_lists
val raw_compare_lists (#a: _) (d: totalorder a) : raw_comparator (list a)
val raw_compare_lists (#a: _) (d: totalorder a) : raw_comparator (list a)
let rec raw_compare_lists #a (d : totalorder a) : raw_comparator (list a) = fun l1 l2 -> match l1, l2 with | [], [] -> Eq | [], _::_ -> Lt | _::_, [] -> Gt | x::xs, y::ys -> match compare x y with | Lt -> Lt | Gt -> Gt | Eq -> raw_compare_lists d xs ys
{ "file_name": "ulib/FStar.Class.TotalOrder.Raw.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 41, "end_line": 84, "start_col": 0, "start_line": 74 }
(* Copyright 2008-2018 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 FStar.Class.TotalOrder.Raw open FStar.Order let flip = function | Lt -> Gt | Eq -> Eq | Gt -> Lt let raw_comparator (a:Type) = a -> a -> order class totalorder (a:Type) = { compare : raw_comparator a; } val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<) x y = compare x y = Lt val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>) x y = compare x y = Gt val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (=) x y = compare x y = Eq val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<=) x y = compare x y <> Gt val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (>=) x y = compare x y <> Lt val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool let (<>) x y = compare x y <> Eq instance _ : totalorder int = { compare = Order.compare_int; } instance _ : totalorder bool = { compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt); } (* Lex order on tuples *) instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = { compare = (fun (xa,xb) (ya, yb) -> match compare xa ya with | Lt -> Lt | Gt -> Gt | Eq -> compare xb yb); } instance totalorder_option #a (d : totalorder a) : totalorder (option a) = { compare = (fun o1 o2 -> match o1, o2 with | None, None -> Eq | None, Some _ -> Lt | Some _, None -> Gt | Some a1, Some a2 -> compare a1 a2); }
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Tactics.Typeclasses.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Order.fst.checked" ], "interface_file": false, "source_file": "FStar.Class.TotalOrder.Raw.fst" }
[ { "abbrev": false, "full_module": "FStar.Order", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "short_module": null }, { "abbrev": false, "full_module": "FStar.Class.TotalOrder", "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
d: FStar.Class.TotalOrder.Raw.totalorder a -> FStar.Class.TotalOrder.Raw.raw_comparator (Prims.list a)
Prims.Tot
[ "total" ]
[]
[ "FStar.Class.TotalOrder.Raw.totalorder", "Prims.list", "FStar.Pervasives.Native.Mktuple2", "FStar.Order.Eq", "FStar.Order.Lt", "FStar.Order.Gt", "FStar.Class.TotalOrder.Raw.compare", "FStar.Class.TotalOrder.Raw.raw_compare_lists", "FStar.Order.order" ]
[ "recursion" ]
false
false
false
true
false
let rec raw_compare_lists #a (d: totalorder a) : raw_comparator (list a) =
fun l1 l2 -> match l1, l2 with | [], [] -> Eq | [], _ :: _ -> Lt | _ :: _, [] -> Gt | x :: xs, y :: ys -> match compare x y with | Lt -> Lt | Gt -> Gt | Eq -> raw_compare_lists d xs ys
false
Hacl.Bignum64.fst
Hacl.Bignum64.bn_to_bytes_be
val bn_to_bytes_be: len:_ -> Hacl.Bignum.Convert.bn_to_bytes_be_st t_limbs len
val bn_to_bytes_be: len:_ -> Hacl.Bignum.Convert.bn_to_bytes_be_st t_limbs len
let bn_to_bytes_be len b res = Hacl.Bignum.Convert.mk_bn_to_bytes_be false len b res
{ "file_name": "code/bignum/Hacl.Bignum64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 55, "end_line": 87, "start_col": 0, "start_line": 86 }
module Hacl.Bignum64 open FStar.Mul module BN = Hacl.Bignum module BE = Hacl.Bignum.Exponentiation module BR = Hacl.Bignum.ModReduction module AM = Hacl.Bignum.AlmostMontgomery module MA = Hacl.Bignum.MontArithmetic module BI = Hacl.Bignum.ModInv module BM = Hacl.Bignum.Montgomery #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract let kam (len:BN.meta_len t_limbs) = AM.mk_runtime_almost_mont #t_limbs len inline_for_extraction noextract let ke (len:BN.meta_len t_limbs) = BE.mk_runtime_exp #t_limbs len let add len a b res = (ke len).BE.bn.BN.add a b res let sub len a b res = (ke len).BE.bn.BN.sub a b res let add_mod len n a b res = (ke len).BE.bn.BN.add_mod_n n a b res let sub_mod len n a b res = (ke len).BE.bn.BN.sub_mod_n n a b res let mul len a b res = (ke len).BE.bn.BN.mul a b res let sqr len a res = (ke len).BE.bn.BN.sqr a res [@CInline] let bn_slow_precomp (len:BN.meta_len t_limbs) : BR.bn_mod_slow_precomp_st t_limbs len = BR.bn_mod_slow_precomp (kam len) let mod len n a res = BS.mk_bn_mod_slow_safe len (BR.mk_bn_mod_slow len (kam len).AM.precomp (bn_slow_precomp len)) n a res let mod_exp_vartime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_vt n a bBits b res let mod_exp_consttime len n a bBits b res = BS.mk_bn_mod_exp_safe len (ke len).BE.exp_check (ke len).BE.exp_ct n a bBits b res let mod_inv_prime_vartime len n a res = BS.mk_bn_mod_inv_prime_safe len (ke len).BE.exp_vt n a res let mont_ctx_init len r n = MA.bn_field_init len (ke len).BE.precompr2 r n let mont_ctx_free k = MA.bn_field_free k let mod_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.bn_mod_ctx len (bn_slow_precomp len1) k a res let mod_exp_vartime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_vt_precomp k a bBits b res let mod_exp_consttime_precomp len k a bBits b res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_exp_ctx len (ke len1).BE.exp_ct_precomp k a bBits b res let mod_inv_prime_vartime_precomp len k a res = let len1 = MA.bn_field_get_len k in BS.mk_bn_mod_inv_prime_ctx len (BI.mk_bn_mod_inv_prime_precomp len1 (ke len1).BE.exp_vt_precomp) k a res let new_bn_from_bytes_be r len b = BS.new_bn_from_bytes_be r len b let new_bn_from_bytes_le r len b = BS.new_bn_from_bytes_le r len b
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Bignum.Montgomery.fsti.checked", "Hacl.Bignum.MontArithmetic.fsti.checked", "Hacl.Bignum.ModReduction.fst.checked", "Hacl.Bignum.ModInv.fst.checked", "Hacl.Bignum.Exponentiation.fsti.checked", "Hacl.Bignum.Convert.fst.checked", "Hacl.Bignum.AlmostMontgomery.fsti.checked", "Hacl.Bignum.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Hacl.Bignum64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Bignum.Montgomery", "short_module": "BM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModInv", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Bignum.AlmostMontgomery", "short_module": "AM" }, { "abbrev": true, "full_module": "Hacl.Bignum.ModReduction", "short_module": "BR" }, { "abbrev": true, "full_module": "Hacl.Bignum.Exponentiation", "short_module": "BE" }, { "abbrev": true, "full_module": "Hacl.Bignum.MontArithmetic", "short_module": "MA" }, { "abbrev": true, "full_module": "Hacl.Bignum.SafeAPI", "short_module": "BS" }, { "abbrev": true, "full_module": "Hacl.Bignum", "short_module": "BN" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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
len: Lib.IntTypes.size_t { 0 < Lib.IntTypes.v len /\ Lib.IntTypes.numbytes Hacl.Bignum64.t_limbs * Lib.IntTypes.v (Hacl.Bignum.Definitions.blocks len (Lib.IntTypes.size (Lib.IntTypes.numbytes Hacl.Bignum64.t_limbs))) <= Lib.IntTypes.max_size_t } -> Hacl.Bignum.Convert.bn_to_bytes_be_st Hacl.Bignum64.t_limbs len
Prims.Tot
[ "total" ]
[]
[ "Lib.IntTypes.size_t", "Prims.l_and", "Prims.b2t", "Prims.op_LessThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.numbytes", "Hacl.Bignum64.t_limbs", "Hacl.Bignum.Definitions.blocks", "Lib.IntTypes.size", "Lib.IntTypes.max_size_t", "Hacl.Bignum.Definitions.lbignum", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "Hacl.Bignum.Convert.mk_bn_to_bytes_be", "Prims.unit" ]
[]
false
false
false
false
false
let bn_to_bytes_be len b res =
Hacl.Bignum.Convert.mk_bn_to_bytes_be false len b res
false
Vale.PPC64LE.InsVector.fst
Vale.PPC64LE.InsVector.va_lemma_Vpmsumd
val va_lemma_Vpmsumd : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vpmsumd dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.add (Vale.Math.Poly2_s.mul (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_lo (va_eval_vec_opr va_s0 src1))) (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_lo (va_eval_vec_opr va_s0 src2)))) (Vale.Math.Poly2_s.mul (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_hi (va_eval_vec_opr va_s0 src1))) (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_hi (va_eval_vec_opr va_s0 src2))))) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
val va_lemma_Vpmsumd : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr -> src1:va_operand_vec_opr -> src2:va_operand_vec_opr -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Vpmsumd dst src1 src2) va_s0 /\ va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src1 va_s0 /\ va_is_src_vec_opr src2 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_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.add (Vale.Math.Poly2_s.mul (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_lo (va_eval_vec_opr va_s0 src1))) (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_lo (va_eval_vec_opr va_s0 src2)))) (Vale.Math.Poly2_s.mul (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_hi (va_eval_vec_opr va_s0 src1))) (Vale.Math.Poly2.Bits_s.of_double32 (Vale.Arch.Types.quad32_double_hi (va_eval_vec_opr va_s0 src2))))) /\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
let va_lemma_Vpmsumd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vpmsumd) (va_code_Vpmsumd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vpmsumd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vpmsumd dst src1 src2)) va_s0 in (va_sM, va_fM)
{ "file_name": "obj/Vale.PPC64LE.InsVector.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1220, "start_col": 0, "start_line": 1215 }
module Vale.PPC64LE.InsVector open Vale.Def.Types_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Spec.Hash.Definitions open Spec.SHA2 friend Vale.PPC64LE.Decls module S = Vale.PPC64LE.Semantics_s #reset-options "--initial_fuel 2 --max_fuel 4 --max_ifuel 2 --z3rlimit 50" //-- Vmr [@ "opaque_to_smt"] let va_code_Vmr dst src = (Ins (S.Vmr dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vmr dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmr va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vmr) (va_code_Vmr dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmr dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmr dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmr dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmr (va_code_Vmr 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrd [@ "opaque_to_smt"] let va_code_Mfvsrd dst src = (Ins (S.Mfvsrd dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrd dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrd va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrd) (va_code_Mfvsrd dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrd dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrd dst src)) va_s0 in Vale.Arch.Types.hi64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrd dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrd (va_code_Mfvsrd 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mfvsrld [@ "opaque_to_smt"] let va_code_Mfvsrld dst src = (Ins (S.Mfvsrld dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mfvsrld dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mfvsrld va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mfvsrld) (va_code_Mfvsrld dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mfvsrld dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mfvsrld dst src)) va_s0 in Vale.Arch.Types.lo64_reveal (); (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mfvsrld dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mfvsrld (va_code_Mfvsrld 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_reg_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_reg_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrdd [@ "opaque_to_smt"] let va_code_Mtvsrdd dst src1 src2 = (Ins (S.Mtvsrdd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrdd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrdd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Mtvsrdd) (va_code_Mtvsrdd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrdd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrdd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrdd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrdd (va_code_Mtvsrdd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Mtvsrws [@ "opaque_to_smt"] let va_code_Mtvsrws dst src = (Ins (S.Mtvsrws dst src)) [@ "opaque_to_smt"] let va_codegen_success_Mtvsrws dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Mtvsrws va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Mtvsrws) (va_code_Mtvsrws dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Mtvsrws dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Mtvsrws dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Mtvsrws dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Mtvsrws (va_code_Mtvsrws 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vadduwm [@ "opaque_to_smt"] let va_code_Vadduwm dst src1 src2 = (Ins (S.Vadduwm dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vadduwm dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vadduwm va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vadduwm) (va_code_Vadduwm dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vadduwm dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vadduwm dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vadduwm dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vadduwm (va_code_Vadduwm 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vxor [@ "opaque_to_smt"] let va_code_Vxor dst src1 src2 = (Ins (S.Vxor dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vxor dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vxor va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vxor) (va_code_Vxor dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vxor dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vxor dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vxor dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vxor (va_code_Vxor 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vand [@ "opaque_to_smt"] let va_code_Vand dst src1 src2 = (Ins (S.Vand dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vand dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vand va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vand) (va_code_Vand dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vand dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vand dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vand dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vand (va_code_Vand 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vslw [@ "opaque_to_smt"] let va_code_Vslw dst src1 src2 = (Ins (S.Vslw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vslw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vslw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vslw) (va_code_Vslw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vslw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vslw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vslw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vslw (va_code_Vslw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsrw [@ "opaque_to_smt"] let va_code_Vsrw dst src1 src2 = (Ins (S.Vsrw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsrw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsrw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsrw) (va_code_Vsrw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsrw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsrw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsrw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsrw (va_code_Vsrw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsl [@ "opaque_to_smt"] let va_code_Vsl dst src1 src2 = (Ins (S.Vsl dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vsl dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsl va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vsl) (va_code_Vsl dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsl dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsl dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsl dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsl (va_code_Vsl 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcmpequw [@ "opaque_to_smt"] let va_code_Vcmpequw dst src1 src2 = (Ins (S.Vcmpequw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcmpequw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcmpequw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcmpequw) (va_code_Vcmpequw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcmpequw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcmpequw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcmpequw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcmpequw (va_code_Vcmpequw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsldoi [@ "opaque_to_smt"] let va_code_Vsldoi dst src1 src2 count = (Ins (S.Vsldoi dst src1 src2 count)) [@ "opaque_to_smt"] let va_codegen_success_Vsldoi dst src1 src2 count = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsldoi va_b0 va_s0 dst src1 src2 count = va_reveal_opaque (`%va_code_Vsldoi) (va_code_Vsldoi dst src1 src2 count); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsldoi dst src1 src2 count)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsldoi dst src1 src2 count)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsldoi dst src1 src2 count va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsldoi (va_code_Vsldoi dst src1 src2 count) va_s0 dst src1 src2 count in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vmrghw [@ "opaque_to_smt"] let va_code_Vmrghw dst src1 src2 = (Ins (S.Vmrghw dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vmrghw dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vmrghw va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vmrghw) (va_code_Vmrghw dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vmrghw dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vmrghw dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vmrghw dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vmrghw (va_code_Vmrghw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Xxmrghd [@ "opaque_to_smt"] let va_code_Xxmrghd dst src1 src2 = (Ins (S.Xxmrghd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Xxmrghd dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Xxmrghd va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Xxmrghd) (va_code_Xxmrghd dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Xxmrghd dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Xxmrghd dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Xxmrghd dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Xxmrghd (va_code_Xxmrghd 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsel [@ "opaque_to_smt"] let va_code_Vsel dst src1 src2 sel = (Ins (S.Vsel dst src1 src2 sel)) [@ "opaque_to_smt"] let va_codegen_success_Vsel dst src1 src2 sel = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsel va_b0 va_s0 dst src1 src2 sel = va_reveal_opaque (`%va_code_Vsel) (va_code_Vsel dst src1 src2 sel); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsel dst src1 src2 sel)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsel dst src1 src2 sel)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsel dst src1 src2 sel va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsel (va_code_Vsel dst src1 src2 sel) va_s0 dst src1 src2 sel in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltw [@ "opaque_to_smt"] let va_code_Vspltw dst src uim = (Ins (S.Vspltw dst src uim)) [@ "opaque_to_smt"] let va_codegen_success_Vspltw dst src uim = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltw va_b0 va_s0 dst src uim = va_reveal_opaque (`%va_code_Vspltw) (va_code_Vspltw dst src uim); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltw dst src uim)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltw dst src uim)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltw dst src uim va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltw (va_code_Vspltw dst src uim) va_s0 dst src uim in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisw [@ "opaque_to_smt"] let va_code_Vspltisw dst src = (Ins (S.Vspltisw dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisw dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisw va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisw) (va_code_Vspltisw dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisw dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisw dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisw dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisw (va_code_Vspltisw 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vspltisb [@ "opaque_to_smt"] let va_code_Vspltisb dst src = (Ins (S.Vspltisb dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vspltisb dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vspltisb va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vspltisb) (va_code_Vspltisb dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vspltisb dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vspltisb dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vspltisb dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vspltisb (va_code_Vspltisb 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_buffer [@ "opaque_to_smt"] let va_code_Load128_buffer h dst base offset t = (Ins (S.Load128 dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_buffer h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_buffer va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_buffer) (va_code_Load128_buffer h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128 dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128 dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_buffer h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_buffer (va_code_Load128_buffer h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_buffer [@ "opaque_to_smt"] let va_code_Store128_buffer h src base offset t = (Ins (S.Store128 src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_buffer h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_buffer va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_buffer) (va_code_Store128_buffer h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128 src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128 src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (va_eval_vec_opr va_old_s src) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_buffer h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_buffer (va_code_Store128_buffer h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer [@ "opaque_to_smt"] let va_code_Load128_word4_buffer h dst base t = (Ins (S.Load128Word4 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer) (va_code_Load128_word4_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer (va_code_Load128_word4_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Load128_word4_buffer_index h dst base offset t = (Ins (S.Load128Word4Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_word4_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_word4_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_word4_buffer_index) (va_code_Load128_word4_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Word4Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Word4Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_word4_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_word4_buffer_index (va_code_Load128_word4_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer [@ "opaque_to_smt"] let va_code_Store128_word4_buffer h src base t = (Ins (S.Store128Word4 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer) (va_code_Store128_word4_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer (va_code_Store128_word4_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_word4_buffer_index [@ "opaque_to_smt"] let va_code_Store128_word4_buffer_index h src base offset t = (Ins (S.Store128Word4Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_word4_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_word4_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_word4_buffer_index) (va_code_Store128_word4_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Word4Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Word4Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi3 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo1 (va_eval_vec_opr va_old_s src)) (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (va_eval_vec_opr va_old_s src))) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_word4_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_word4_buffer_index (va_code_Store128_word4_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer h dst base t = (Ins (S.Load128Byte16 dst base)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer h dst base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer va_b0 va_s0 h dst base t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer) (va_code_Load128_byte16_buffer h dst base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16 dst base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16 dst base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer h dst base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer (va_code_Load128_byte16_buffer h dst base t) va_s0 h dst base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Load128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Load128_byte16_buffer_index h dst base offset t = (Ins (S.Load128Byte16Index dst base offset)) [@ "opaque_to_smt"] let va_codegen_success_Load128_byte16_buffer_index h dst base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Load128_byte16_buffer_index va_b0 va_s0 h dst base offset t b index = va_reveal_opaque (`%va_code_Load128_byte16_buffer_index) (va_code_Load128_byte16_buffer_index h dst base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Load128Byte16Index dst base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Load128Byte16Index dst base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_load_mem128_full b index (Vale.PPC64LE.Decls.from_heap_impl (va_sM.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Load128_byte16_buffer_index h dst base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Load128_byte16_buffer_index (va_code_Load128_byte16_buffer_index h dst base offset t) va_s0 h dst base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer h src base t = (Ins (S.Store128Byte16 src base)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer h src base t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer va_b0 va_s0 h src base t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer) (va_code_Store128_byte16_buffer h src base t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16 src base)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16 src base)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer h src base t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer (va_code_Store128_byte16_buffer h src base t) va_s0 h src base t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Store128_byte16_buffer_index [@ "opaque_to_smt"] let va_code_Store128_byte16_buffer_index h src base offset t = (Ins (S.Store128Byte16Index src base offset)) [@ "opaque_to_smt"] let va_codegen_success_Store128_byte16_buffer_index h src base offset t = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Store128_byte16_buffer_index va_b0 va_s0 h src base offset t b index = va_reveal_opaque (`%va_code_Store128_byte16_buffer_index) (va_code_Store128_byte16_buffer_index h src base offset t); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Store128Byte16Index src base offset)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Store128Byte16Index src base offset)) va_s0 in Vale.PPC64LE.Memory_Sems.low_lemma_store_mem128_full b index (Vale.Def.Types_s.reverse_bytes_quad32 (va_eval_vec_opr va_old_s src)) (Vale.PPC64LE.Decls.from_heap_impl (va_old_s.ms_heap)) t h; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Store128_byte16_buffer_index h src base offset t b index va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store128_byte16_buffer_index (va_code_Store128_byte16_buffer_index h src base offset t) va_s0 h src base offset t b index in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM (va_update_operand_heaplet h va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem; va_mod_heaplet h]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma0 [@ "opaque_to_smt"] let va_code_SHA256_sigma0 dst src = (Ins (S.Vshasigmaw0 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma0 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma0) (va_code_SHA256_sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw0 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw0 dst src)) va_s0 in lemma_sha256_sigma0 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma0 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma0 (va_code_SHA256_sigma0 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_sigma1 [@ "opaque_to_smt"] let va_code_SHA256_sigma1 dst src = (Ins (S.Vshasigmaw1 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_sigma1 va_b0 va_s0 dst src t block = va_reveal_opaque (`%va_code_SHA256_sigma1) (va_code_SHA256_sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw1 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw1 dst src)) va_s0 in lemma_sha256_sigma1 (va_eval_vec_opr va_old_s src) t block; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_sigma1 dst src t block va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_sigma1 (va_code_SHA256_sigma1 dst src) va_s0 dst src t block in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma0 [@ "opaque_to_smt"] let va_code_SHA256_Sigma0 dst src = (Ins (S.Vshasigmaw2 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma0 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma0 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma0) (va_code_SHA256_Sigma0 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw2 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw2 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma2 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma0 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma0 (va_code_SHA256_Sigma0 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- SHA256_Sigma1 [@ "opaque_to_smt"] let va_code_SHA256_Sigma1 dst src = (Ins (S.Vshasigmaw3 dst src)) [@ "opaque_to_smt"] let va_codegen_success_SHA256_Sigma1 dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_SHA256_Sigma1 va_b0 va_s0 dst src t block hash_orig = va_reveal_opaque (`%va_code_SHA256_Sigma1) (va_code_SHA256_Sigma1 dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vshasigmaw3 dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vshasigmaw3 dst src)) va_s0 in Vale.SHA.PPC64LE.SHA_helpers.lemma_sha256_sigma3 (va_eval_vec_opr va_old_s src) t block hash_orig; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_SHA256_Sigma1 dst src t block hash_orig va_s0 va_k = let (va_sM, va_f0) = va_lemma_SHA256_Sigma1 (va_code_SHA256_Sigma1 dst src) va_s0 dst src t block hash_orig in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vsbox [@ "opaque_to_smt"] let va_code_Vsbox dst src = (Ins (S.Vsbox dst src)) [@ "opaque_to_smt"] let va_codegen_success_Vsbox dst src = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vsbox va_b0 va_s0 dst src = va_reveal_opaque (`%va_code_Vsbox) (va_code_Vsbox dst src); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vsbox dst src)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vsbox dst src)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vsbox dst src va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vsbox (va_code_Vsbox 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- RotWord [@ "opaque_to_smt"] let va_code_RotWord dst src1 src2 = (Ins (S.RotWord dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_RotWord dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_RotWord va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_RotWord) (va_code_RotWord dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.RotWord dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.RotWord dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_RotWord dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_RotWord (va_code_RotWord 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipher [@ "opaque_to_smt"] let va_code_Vcipher dst src1 src2 = (Ins (S.Vcipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipher) (va_code_Vcipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipher (va_code_Vcipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vcipherlast [@ "opaque_to_smt"] let va_code_Vcipherlast dst src1 src2 = (Ins (S.Vcipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vcipherlast dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vcipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vcipherlast) (va_code_Vcipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vcipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vcipherlast dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vcipherlast dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vcipherlast (va_code_Vcipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipher [@ "opaque_to_smt"] let va_code_Vncipher dst src1 src2 = (Ins (S.Vncipher dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipher dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vncipher va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipher) (va_code_Vncipher dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipher dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipher dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vncipher dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vncipher (va_code_Vncipher 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vncipherlast [@ "opaque_to_smt"] let va_code_Vncipherlast dst src1 src2 = (Ins (S.Vncipherlast dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vncipherlast dst src1 src2 = (va_ttrue ()) [@"opaque_to_smt"] let va_lemma_Vncipherlast va_b0 va_s0 dst src1 src2 = va_reveal_opaque (`%va_code_Vncipherlast) (va_code_Vncipherlast dst src1 src2); let (va_old_s:va_state) = va_s0 in va_ins_lemma (Ins (S.Vncipherlast dst src1 src2)) va_s0; let (va_sM, va_fM) = va_eval_ins (Ins (S.Vncipherlast dst src1 src2)) va_s0 in (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Vncipherlast dst src1 src2 va_s0 va_k = let (va_sM, va_f0) = va_lemma_Vncipherlast (va_code_Vncipherlast 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_vec_opr dst va_sM va_s0))); va_lemma_norm_mods ([va_mod_vec_opr dst]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Vpmsumd [@ "opaque_to_smt"] let va_code_Vpmsumd dst src1 src2 = (Ins (S.Vpmsumd dst src1 src2)) [@ "opaque_to_smt"] let va_codegen_success_Vpmsumd dst src1 src2 = (va_ttrue ())
{ "checked_file": "/", "dependencies": [ "Vale.SHA.PPC64LE.SHA_helpers.fsti.checked", "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.Semantics_s.fst.checked", "Vale.PPC64LE.Memory_Sems.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.PPC64LE.Decls.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.Types.fsti.checked", "Spec.SHA2.fsti.checked", "Spec.Hash.Definitions.fst.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.InsVector.fst" }
[ { "abbrev": true, "full_module": "Vale.PPC64LE.Semantics_s", "short_module": "S" }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2.Bits_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.SHA.PPC64LE.SHA_helpers", "short_module": null }, { "abbrev": false, "full_module": "Spec.Hash.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Spec.SHA2", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Sel", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Two_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 4, "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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> dst: Vale.PPC64LE.Decls.va_operand_vec_opr -> src1: Vale.PPC64LE.Decls.va_operand_vec_opr -> src2: Vale.PPC64LE.Decls.va_operand_vec_opr -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Decls.va_operand_vec_opr", "Vale.PPC64LE.State.state", "Vale.PPC64LE.Lemmas.fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Prims.nat", "Vale.PPC64LE.Decls.va_eval_ins", "Vale.PPC64LE.Machine_s.Ins", "Vale.PPC64LE.Semantics_s.ins", "Vale.PPC64LE.Semantics_s.ocmp", "Vale.PPC64LE.Semantics_s.Vpmsumd", "Prims.unit", "Vale.PPC64LE.Decls.va_ins_lemma", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_reveal_opaque", "Vale.PPC64LE.InsVector.va_code_Vpmsumd" ]
[]
false
false
false
false
false
let va_lemma_Vpmsumd va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_Vpmsumd) (va_code_Vpmsumd dst src1 src2); let va_old_s:va_state = va_s0 in va_ins_lemma (Ins (S.Vpmsumd dst src1 src2)) va_s0; let va_sM, va_fM = va_eval_ins (Ins (S.Vpmsumd dst src1 src2)) va_s0 in (va_sM, va_fM)
false
HashingOptions.fst
HashingOptions.is_weak
val is_weak : _: HashingOptions.check_hashes_t -> Prims.bool
let is_weak = function | WeakHashes | InplaceHashes -> true | _ -> false
{ "file_name": "src/3d/HashingOptions.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 14, "end_line": 8, "start_col": 0, "start_line": 5 }
module HashingOptions type check_hashes_t = | WeakHashes | StrongHashes | InplaceHashes
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "HashingOptions.fst" }
[ { "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
_: HashingOptions.check_hashes_t -> Prims.bool
Prims.Tot
[ "total" ]
[]
[ "HashingOptions.check_hashes_t", "Prims.bool" ]
[]
false
false
false
true
false
let is_weak =
function | WeakHashes | InplaceHashes -> true | _ -> false
false
HashingOptions.fst
HashingOptions.string_of_input_stream_binding
val string_of_input_stream_binding : _: HashingOptions.input_stream_binding_t -> Prims.string
let string_of_input_stream_binding = function | InputStreamBuffer -> "buffer" | InputStreamExtern _ -> "extern" | InputStreamStatic _ -> "static"
{ "file_name": "src/3d/HashingOptions.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 35, "end_line": 33, "start_col": 0, "start_line": 30 }
module HashingOptions type check_hashes_t = | WeakHashes | StrongHashes | InplaceHashes let is_weak = function | WeakHashes | InplaceHashes -> true | _ -> false type micro_step_t = | MicroStepVerify | MicroStepExtract | MicroStepCopyClangFormat | MicroStepCopyEverParseH | MicroStepEmitConfig type makefile_type = | MakefileGMake | MakefileNMake type input_stream_binding_t = | InputStreamBuffer | InputStreamExtern: (include_file: string) -> input_stream_binding_t | InputStreamStatic: (include_file: string) -> input_stream_binding_t
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "HashingOptions.fst" }
[ { "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
_: HashingOptions.input_stream_binding_t -> Prims.string
Prims.Tot
[ "total" ]
[]
[ "HashingOptions.input_stream_binding_t", "Prims.string" ]
[]
false
false
false
true
false
let string_of_input_stream_binding =
function | InputStreamBuffer -> "buffer" | InputStreamExtern _ -> "extern" | InputStreamStatic _ -> "static"
false
HashingOptions.fst
HashingOptions.input_stream_include
val input_stream_include : _: HashingOptions.input_stream_binding_t -> Prims.string
let input_stream_include = function | InputStreamBuffer -> "" | InputStreamStatic s | InputStreamExtern s -> s
{ "file_name": "src/3d/HashingOptions.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 28, "end_line": 38, "start_col": 0, "start_line": 35 }
module HashingOptions type check_hashes_t = | WeakHashes | StrongHashes | InplaceHashes let is_weak = function | WeakHashes | InplaceHashes -> true | _ -> false type micro_step_t = | MicroStepVerify | MicroStepExtract | MicroStepCopyClangFormat | MicroStepCopyEverParseH | MicroStepEmitConfig type makefile_type = | MakefileGMake | MakefileNMake type input_stream_binding_t = | InputStreamBuffer | InputStreamExtern: (include_file: string) -> input_stream_binding_t | InputStreamStatic: (include_file: string) -> input_stream_binding_t let string_of_input_stream_binding = function | InputStreamBuffer -> "buffer" | InputStreamExtern _ -> "extern" | InputStreamStatic _ -> "static"
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "HashingOptions.fst" }
[ { "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
_: HashingOptions.input_stream_binding_t -> Prims.string
Prims.Tot
[ "total" ]
[]
[ "HashingOptions.input_stream_binding_t", "Prims.string" ]
[]
false
false
false
true
false
let input_stream_include =
function | InputStreamBuffer -> "" | InputStreamStatic s | InputStreamExtern s -> s
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.felem
val felem : w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 24, "start_col": 0, "start_line": 24 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Lib.Buffer.lbuffer", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
true
true
let felem (w: lanes) =
lbuffer (uint64xN w) 5ul
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.felem_wide
val felem_wide : w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0
let felem_wide (w:lanes) = felem w
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 34, "end_line": 26, "start_col": 0, "start_line": 26 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem" ]
[]
false
false
false
true
true
let felem_wide (w: lanes) =
felem w
false
SteelLock.fst
SteelLock.main
val main: Prims.unit -> SteelT Int32.t emp (fun _ -> emp)
val main: Prims.unit -> SteelT Int32.t emp (fun _ -> emp)
let main () : SteelT Int32.t emp (fun _ -> emp) = let r = malloc 0ul in let l = new_lock (vptr r) in acquire l; write r 1ul; release l; 0l
{ "file_name": "share/steel/tests/krml/SteelLock.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 4, "end_line": 14, "start_col": 0, "start_line": 8 }
module SteelLock open Steel.Effect.Atomic open Steel.Effect open Steel.Reference open Steel.SpinLock
{ "checked_file": "/", "dependencies": [ "Steel.SpinLock.fsti.checked", "Steel.Reference.fsti.checked", "Steel.Effect.Atomic.fsti.checked", "Steel.Effect.fsti.checked", "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int32.fsti.checked" ], "interface_file": false, "source_file": "SteelLock.fst" }
[ { "abbrev": false, "full_module": "Steel.SpinLock", "short_module": null }, { "abbrev": false, "full_module": "Steel.Reference", "short_module": null }, { "abbrev": false, "full_module": "Steel.Effect", "short_module": null }, { "abbrev": false, "full_module": "Steel.Effect.Atomic", "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
_: Prims.unit -> Steel.Effect.SteelT FStar.Int32.t
Steel.Effect.SteelT
[]
[]
[ "Prims.unit", "FStar.Int32.__int_to_t", "FStar.Int32.t", "Steel.SpinLock.release", "Steel.Reference.vptr", "FStar.UInt32.t", "Steel.Reference.write", "FStar.UInt32.__uint_to_t", "Steel.SpinLock.acquire", "Steel.SpinLock.lock", "Steel.Effect.Common.VUnit", "Steel.Reference.vptr'", "Steel.FractionalPermission.full_perm", "Steel.SpinLock.new_lock", "Steel.Reference.ref", "Steel.Reference.malloc", "Steel.Effect.Common.emp", "Steel.Effect.Common.vprop" ]
[]
false
true
false
false
false
let main () : SteelT Int32.t emp (fun _ -> emp) =
let r = malloc 0ul in let l = new_lock (vptr r) in acquire l; write r 1ul; release l; 0l
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.precomp_r
val precomp_r : w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 51, "end_line": 28, "start_col": 0, "start_line": 28 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Lib.Buffer.lbuffer", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
true
true
let precomp_r (w: lanes) =
lbuffer (uint64xN w) 20ul
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.op_String_Access
val op_String_Access : s: Lib.Sequence.lseq a len -> i: (n: Prims.nat{n <= Prims.pow2 32 - 1}){i < len} -> r: a{r == FStar.Seq.Base.index (Lib.Sequence.to_seq s) i}
let op_String_Access #a #len = LSeq.index #a #len
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 49, "end_line": 31, "start_col": 0, "start_line": 31 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Lib.Sequence.lseq a len -> i: (n: Prims.nat{n <= Prims.pow2 32 - 1}){i < len} -> r: a{r == FStar.Seq.Base.index (Lib.Sequence.to_seq s) i}
Prims.Tot
[ "total" ]
[]
[ "Lib.IntTypes.size_nat", "Lib.Sequence.index", "Lib.Sequence.lseq", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Subtraction", "Prims.pow2", "Prims.op_LessThan", "Prims.eq2", "FStar.Seq.Base.index", "Lib.Sequence.to_seq" ]
[]
false
false
false
false
false
let ( .[] ) #a #len =
LSeq.index #a #len
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.fas_nat
val fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w)
val fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w)
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 24, "end_line": 60, "start_col": 0, "start_line": 59 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> Prims.GTot (Lib.Sequence.lseq Prims.nat w)
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.fas_nat5", "Hacl.Impl.Poly1305.Field32xN.as_tup5", "Lib.Sequence.lseq", "Prims.nat" ]
[]
false
false
false
false
false
let fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.feval
val feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w)
val feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w)
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 56, "start_col": 0, "start_line": 55 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> Prims.GTot (Lib.Sequence.lseq Hacl.Spec.Poly1305.Vec.pfelem w)
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.feval5", "Hacl.Impl.Poly1305.Field32xN.as_tup5", "Lib.Sequence.lseq", "Hacl.Spec.Poly1305.Vec.pfelem" ]
[]
false
false
false
false
false
let feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.felem_less
val felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0
val felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 31, "end_line": 64, "start_col": 0, "start_line": 63 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> max: Prims.nat -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "Prims.nat", "Hacl.Spec.Poly1305.Field32xN.felem_less5", "Hacl.Impl.Poly1305.Field32xN.as_tup5" ]
[]
false
false
false
false
true
let felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0 =
felem_less5 (as_tup5 h f) max
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.felem_fits
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 29, "end_line": 47, "start_col": 0, "start_line": 46 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> m: Hacl.Spec.Poly1305.Field32xN.scale32_5 -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.scale32_5", "Hacl.Spec.Poly1305.Field32xN.felem_fits5", "Hacl.Impl.Poly1305.Field32xN.as_tup5" ]
[]
false
false
false
false
true
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.b8
val b8 : Type0
let b8 = IB.b8
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 14, "end_line": 23, "start_col": 0, "start_line": 23 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1"
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.Types.b8" ]
[]
false
false
false
true
true
let b8 =
IB.b8
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.felem_wide_fits
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 34, "end_line": 52, "start_col": 0, "start_line": 51 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> m: Hacl.Spec.Poly1305.Field32xN.scale32_5 -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.scale32_5", "Hacl.Spec.Poly1305.Field32xN.felem_wide_fits5", "Hacl.Impl.Poly1305.Field32xN.as_tup5" ]
[]
false
false
false
false
true
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.tuint8
val tuint8 : Prims.eqtype
let tuint8 = UInt8.t
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 20, "end_line": 31, "start_col": 0, "start_line": 31 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Prims.eqtype
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt8.t" ]
[]
false
false
false
true
false
let tuint8 =
UInt8.t
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.tuint16
val tuint16 : Prims.eqtype
let tuint16 = UInt16.t
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 32, "start_col": 0, "start_line": 32 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Prims.eqtype
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt16.t" ]
[]
false
false
false
true
false
let tuint16 =
UInt16.t
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.tuint64
val tuint64 : Prims.eqtype
let tuint64 = UInt64.t
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 34, "start_col": 0, "start_line": 34 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Prims.eqtype
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.t" ]
[]
false
false
false
true
false
let tuint64 =
UInt64.t
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.as_tup5
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 18, "end_line": 42, "start_col": 0, "start_line": 35 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> Prims.GTot (Hacl.Spec.Poly1305.Field32xN.felem5 w)
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "FStar.Pervasives.Native.Mktuple5", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "Prims.eq2", "FStar.Seq.Base.index", "Lib.Sequence.to_seq", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "FStar.UInt32.uint_to_t", "FStar.UInt32.t", "Hacl.Impl.Poly1305.Field32xN.op_String_Access", "FStar.UInt32.__uint_to_t", "Lib.Sequence.lseq", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Hacl.Spec.Poly1305.Field32xN.felem5" ]
[]
false
false
false
false
false
let as_tup5 #w h f =
let s = as_seq h f in let s0 = s.[ 0 ] in let s1 = s.[ 1 ] in let s2 = s.[ 2 ] in let s3 = s.[ 3 ] in let s4 = s.[ 4 ] in (s0, s1, s2, s3, s4)
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.tuint32
val tuint32 : Prims.eqtype
let tuint32 = UInt32.t
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 33, "start_col": 0, "start_line": 33 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Prims.eqtype
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt32.t" ]
[]
false
false
false
true
false
let tuint32 =
UInt32.t
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.lemma_feval_is_fas_nat
val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 38, "end_line": 74, "start_col": 0, "start_line": 73 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.Pervasives.Lemma (requires Hacl.Impl.Poly1305.Field32xN.felem_less h f (Prims.pow2 128)) (ensures forall (i: Prims.nat). i < w ==> (Hacl.Impl.Poly1305.Field32xN.feval h f).[ i ] == (Hacl.Impl.Poly1305.Field32xN.fas_nat h f).[ i ])
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.Lemmas.lemma_feval_is_fas_nat", "Hacl.Impl.Poly1305.Field32xN.as_tup5", "Prims.unit" ]
[]
true
false
true
false
false
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.get_heaplet_id
val get_heaplet_id (h:vale_heap) : option heaplet_id
val get_heaplet_id (h:vale_heap) : option heaplet_id
let get_heaplet_id h = h.heapletId
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 13, "end_line": 29, "start_col": 0, "start_line": 28 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: Vale.Arch.HeapImpl.vale_heap -> FStar.Pervasives.Native.option Vale.Arch.HeapImpl.heaplet_id
Prims.Tot
[ "total" ]
[]
[ "Vale.Arch.HeapImpl.vale_heap", "Vale.Arch.HeapImpl.__proj__ValeHeap__item__heapletId", "FStar.Pervasives.Native.option", "Vale.Arch.HeapImpl.heaplet_id" ]
[]
false
false
false
true
false
let get_heaplet_id h =
h.heapletId
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.uint32_view
val uint32_view : LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt32.t
let uint32_view = Vale.Interop.Views.up_view32
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 60, "start_col": 0, "start_line": 60 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt32.t
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.Views.up_view32" ]
[]
false
false
false
true
false
let uint32_view =
Vale.Interop.Views.up_view32
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.uint16_view
val uint16_view : LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt16.t
let uint16_view = Vale.Interop.Views.up_view16
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 59, "start_col": 0, "start_line": 59 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = ()
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt16.t
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.Views.up_view16" ]
[]
false
false
false
true
false
let uint16_view =
Vale.Interop.Views.up_view16
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.uint64_view
val uint64_view : LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt64.t
let uint64_view = Vale.Interop.Views.up_view64
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 61, "start_col": 0, "start_line": 61 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.Views.up_view64" ]
[]
false
false
false
true
false
let uint64_view =
Vale.Interop.Views.up_view64
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.uint8_view
val uint8_view : LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt8.t
let uint8_view = Vale.Interop.Views.up_view8
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 44, "end_line": 58, "start_col": 0, "start_line": 58 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = ()
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowStar.BufferView.Up.view FStar.UInt8.t FStar.UInt8.t
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.Views.up_view8" ]
[]
false
false
false
true
false
let uint8_view =
Vale.Interop.Views.up_view8
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.buffer_writeable
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
let buffer_writeable #t b = b.writeable
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 39, "end_line": 77, "start_col": 0, "start_line": 77 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b: Vale.PPC64LE.Memory.buffer t -> Prims.GTot Vale.Def.Prop_s.prop0
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.buffer", "Prims.b2t", "Vale.Interop.Types.__proj__Buffer__item__writeable", "Vale.Def.Prop_s.prop0" ]
[]
false
false
false
false
false
let buffer_writeable #t b =
b.writeable
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.uint128_view
val uint128_view : LowStar.BufferView.Up.view FStar.UInt8.t Vale.Def.Types_s.quad32
let uint128_view = Vale.Interop.Views.up_view128
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 48, "end_line": 62, "start_col": 0, "start_line": 62 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowStar.BufferView.Up.view FStar.UInt8.t Vale.Def.Types_s.quad32
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.Views.up_view128" ]
[]
false
false
false
true
false
let uint128_view =
Vale.Interop.Views.up_view128
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc
val loc : Type u#0
val loc : Type u#0
let loc = M.loc
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 79, "start_col": 0, "start_line": 79 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "LowStar.Monotonic.Buffer.loc" ]
[]
false
false
false
true
true
let loc =
M.loc
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_union
val loc_union (s1 s2:loc) : GTot loc
val loc_union (s1 s2:loc) : GTot loc
let loc_union = M.loc_union
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 27, "end_line": 81, "start_col": 0, "start_line": 81 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s1: Vale.PPC64LE.Memory.loc -> s2: Vale.PPC64LE.Memory.loc -> Prims.GTot Vale.PPC64LE.Memory.loc
Prims.GTot
[ "sometrivial" ]
[]
[ "LowStar.Monotonic.Buffer.loc_union" ]
[]
false
false
false
false
false
let loc_union =
M.loc_union
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.buffer_readable
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h))
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 65, "end_line": 76, "start_col": 0, "start_line": 76 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: Vale.Arch.HeapImpl.vale_heap -> b: Vale.PPC64LE.Memory.buffer t -> Prims.GTot Vale.Def.Prop_s.prop0
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.Arch.HeapImpl.vale_heap", "Vale.PPC64LE.Memory.buffer", "FStar.List.Tot.Base.memP", "Vale.Interop.Types.b8", "Vale.Interop.Heap_s.ptrs_of_mem", "Vale.Arch.HeapImpl._ih", "Vale.Def.Prop_s.prop0" ]
[]
false
false
false
false
false
let buffer_readable #t h b =
List.memP b (IB.ptrs_of_mem (_ih h))
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_none
val loc_none : loc
val loc_none : loc
let loc_none = M.loc_none
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 25, "end_line": 80, "start_col": 0, "start_line": 80 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Vale.PPC64LE.Memory.loc
Prims.Tot
[ "total" ]
[]
[ "LowStar.Monotonic.Buffer.loc_none" ]
[]
false
false
false
true
false
let loc_none =
M.loc_none
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.load_precompute_r_post
val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0
val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0
let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0]
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 104, "start_col": 0, "start_line": 95 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Poly1305.Field32xN.precomp_r w -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.precomp_r", "Prims.l_and", "Hacl.Impl.Poly1305.Field32xN.fmul_precomp_r_pre", "Hacl.Impl.Poly1305.Field32xN.felem_fits", "FStar.Pervasives.Native.Mktuple5", "Prims.nat", "Prims.eq2", "Hacl.Spec.Poly1305.Field32xN.felem5", "Hacl.Impl.Poly1305.Field32xN.as_tup5", "Hacl.Spec.Poly1305.Field32xN.precomp_r5", "Lib.Sequence.lseq", "Hacl.Spec.Poly1305.Vec.pfelem", "Hacl.Impl.Poly1305.Field32xN.feval", "Hacl.Spec.Poly1305.Vec.compute_rw", "Hacl.Impl.Poly1305.Field32xN.op_String_Access", "Lib.Buffer.lbuffer_t", "Lib.Buffer.MUT", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.uint_to_t", "FStar.UInt32.t", "Lib.Buffer.gsub", "FStar.UInt32.__uint_to_t", "Prims.unit", "FStar.Pervasives.assert_norm", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Hacl.Spec.Poly1305.Vec.prime" ]
[]
false
false
false
false
true
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[ 0 ]
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_disjoint
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_disjoint (s1 s2:loc) : GTot prop0
let loc_disjoint = M.loc_disjoint
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 33, "end_line": 83, "start_col": 0, "start_line": 83 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s1: Vale.PPC64LE.Memory.loc -> s2: Vale.PPC64LE.Memory.loc -> Prims.GTot Vale.Def.Prop_s.prop0
Prims.GTot
[ "sometrivial" ]
[]
[ "LowStar.Monotonic.Buffer.loc_disjoint" ]
[]
false
false
false
false
false
let loc_disjoint =
M.loc_disjoint
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_buffer
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
let loc_buffer #t b = M.loc_buffer b.bsrc
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 41, "end_line": 82, "start_col": 0, "start_line": 82 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b: Vale.PPC64LE.Memory.buffer t -> Prims.GTot Vale.PPC64LE.Memory.loc
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.buffer", "LowStar.Monotonic.Buffer.loc_buffer", "Vale.Interop.Types.base_typ_as_type", "Vale.Interop.Types.__proj__Buffer__item__src", "Vale.Interop.Types.b8_preorder", "Vale.Interop.Types.__proj__Buffer__item__writeable", "Vale.Interop.Types.__proj__Buffer__item__bsrc", "Vale.PPC64LE.Memory.loc" ]
[]
false
false
false
false
false
let loc_buffer #t b =
M.loc_buffer b.bsrc
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.buffer_addr
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 50, "end_line": 92, "start_col": 0, "start_line": 92 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b: Vale.PPC64LE.Memory.buffer t -> h: Vale.Arch.HeapImpl.vale_heap -> Prims.GTot Prims.int
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.buffer", "Vale.Arch.HeapImpl.vale_heap", "Vale.Interop.Heap_s.addrs_of_mem", "Vale.Arch.HeapImpl._ih", "Prims.int" ]
[]
false
false
false
false
false
let buffer_addr #t b h =
IB.addrs_of_mem (_ih h) b
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_includes
val loc_includes (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
let loc_includes = M.loc_includes
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 33, "end_line": 84, "start_col": 0, "start_line": 84 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s1: Vale.PPC64LE.Memory.loc -> s2: Vale.PPC64LE.Memory.loc -> Prims.GTot Vale.Def.Prop_s.prop0
Prims.GTot
[ "sometrivial" ]
[]
[ "LowStar.Monotonic.Buffer.loc_includes" ]
[]
false
false
false
false
false
let loc_includes =
M.loc_includes
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.modifies_goal_directed
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
let modifies_goal_directed s h1 h2 = modifies s h1 h2
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 53, "end_line": 198, "start_col": 0, "start_line": 198 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Vale.PPC64LE.Memory.loc -> h1: Vale.Arch.HeapImpl.vale_heap -> h2: Vale.Arch.HeapImpl.vale_heap -> Prims.GTot Vale.Def.Prop_s.prop0
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.PPC64LE.Memory.loc", "Vale.Arch.HeapImpl.vale_heap", "Vale.PPC64LE.Memory.modifies", "Vale.Def.Prop_s.prop0" ]
[]
false
false
false
false
false
let modifies_goal_directed s h1 h2 =
modifies s h1 h2
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.create_felem
val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0)
val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0)
let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 3, "end_line": 118, "start_col": 0, "start_line": 114 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
w: Hacl.Spec.Poly1305.Field32xN.lanes -> FStar.HyperStack.ST.StackInline (Hacl.Impl.Poly1305.Field32xN.felem w)
FStar.HyperStack.ST.StackInline
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Prims.unit", "Lib.Sequence.eq_intro", "Hacl.Spec.Poly1305.Vec.pfelem", "Hacl.Impl.Poly1305.Field32xN.feval", "Lib.Sequence.create", "Hacl.Impl.Poly1305.Field32xN.felem", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Lib.Buffer.lbuffer_t", "Lib.Buffer.MUT", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.uint_to_t", "FStar.UInt32.t", "Lib.Buffer.create", "FStar.UInt32.__uint_to_t", "Hacl.Spec.Poly1305.Field32xN.zero", "Lib.Buffer.lbuffer" ]
[]
false
true
false
false
false
let create_felem w =
let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.fmul_precomp_r_pre
val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0
val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0
let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 43, "end_line": 87, "start_col": 0, "start_line": 82 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> precomp: Hacl.Impl.Poly1305.Field32xN.precomp_r w -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Poly1305.Field32xN.precomp_r", "Prims.l_and", "Hacl.Impl.Poly1305.Field32xN.felem_fits", "FStar.Pervasives.Native.Mktuple5", "Prims.nat", "Prims.eq2", "Hacl.Spec.Poly1305.Field32xN.felem5", "Hacl.Impl.Poly1305.Field32xN.as_tup5", "Hacl.Spec.Poly1305.Field32xN.precomp_r5", "Lib.Buffer.lbuffer_t", "Lib.Buffer.MUT", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.uint_to_t", "FStar.UInt32.t", "Lib.Buffer.gsub", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
false
true
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.set_bit128
val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 34, "end_line": 166, "start_col": 0, "start_line": 158 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.Lemmas.set_bit5_lemma", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.__uint_to_t", "Prims.unit", "Lib.Buffer.op_Array_Assignment", "Lib.IntVector.vec_or", "Lib.IntTypes.U64", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Lib.Buffer.op_Array_Access", "Lib.IntVector.vec_t", "Prims.eq2", "Lib.Sequence.lseq", "Lib.IntTypes.int_t", "Lib.IntTypes.SEC", "Lib.IntVector.vec_v", "Lib.Sequence.create", "Lib.IntVector.vec_load", "Prims._assert", "Lib.IntTypes.range_t", "Lib.IntTypes.v", "Lib.IntTypes.op_Less_Less_Dot", "Lib.IntTypes.u64", "FStar.Pervasives.assert_norm", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.pow2", "Lib.IntTypes.range" ]
[]
false
true
false
false
false
let set_bit128 #w f =
let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.fmul_rn
val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p = let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 25, "end_line": 369, "start_col": 0, "start_line": 366 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #push-options "--max_fuel 1" inline_for_extraction noextract val fmul_r: #w:lanes -> out:felem w -> f1:felem w -> r:felem w -> r5:felem w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h r /\ live h r5 /\ felem_fits h f1 (3,3,3,3,3) /\ felem_fits h r (2,2,2,2,2) /\ felem_fits h r5 (10,10,10,10,10) /\ as_tup5 h r5 == precomp_r5 (as_tup5 h r)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) let fmul_r #w out f1 r r5 = let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let (o0, o1, o2, o3, o4) = fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #pop-options inline_for_extraction noextract val fadd_mul_r: #w:lanes -> acc:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h acc /\ live h f1 /\ live h p /\ felem_fits h acc (2,2,2,2,2) /\ felem_fits h f1 (1,1,1,1,1) /\ fmul_precomp_r_pre h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (1,2,1,1,2) /\ feval h1 acc == LSeq.map2 (Vec.pfmul) (LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) let fadd_mul_r #w out f1 p = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let a0 = out.(0ul) in let a1 = out.(1ul) in let a2 = out.(2ul) in let a3 = out.(3ul) in let a4 = out.(4ul) in let (o0, o1, o2, o3, o4) = fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 inline_for_extraction noextract val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
out: Hacl.Impl.Poly1305.Field32xN.felem w -> f1: Hacl.Impl.Poly1305.Field32xN.felem w -> p: Hacl.Impl.Poly1305.Field32xN.precomp_r w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Impl.Poly1305.Field32xN.precomp_r", "Hacl.Impl.Poly1305.Field32xN.fmul_r", "Prims.unit", "Lib.Buffer.lbuffer_t", "Lib.Buffer.MUT", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.uint_to_t", "FStar.UInt32.t", "Lib.Buffer.sub", "FStar.UInt32.__uint_to_t" ]
[]
false
true
false
false
false
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.copy_felem
val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2)
val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 206, "start_col": 0, "start_line": 201 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f1: Hacl.Impl.Poly1305.Field32xN.felem w -> f2: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Spec.Poly1305.Field32xN.scale32_5", "Hacl.Impl.Poly1305.Field32xN.felem", "Lib.Buffer.op_Array_Assignment", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.__uint_to_t", "Prims.unit", "Lib.Buffer.op_Array_Access", "Lib.Buffer.MUT" ]
[]
false
true
false
false
false
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul)
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.v_of_typ
val v_of_typ (t: base_typ) (v: base_typ_as_vale_type t) : base_typ_as_type t
val v_of_typ (t: base_typ) (v: base_typ_as_vale_type t) : base_typ_as_type t
let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 17, "end_line": 42, "start_col": 0, "start_line": 36 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t: Vale.Arch.HeapTypes_s.base_typ -> v: Vale.PPC64LE.Memory.base_typ_as_vale_type t -> Vale.Interop.Types.base_typ_as_type t
Prims.Tot
[ "total" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.base_typ_as_vale_type", "FStar.UInt8.uint_to_t", "FStar.UInt16.uint_to_t", "FStar.UInt32.uint_to_t", "FStar.UInt64.uint_to_t", "Vale.Interop.Types.base_typ_as_type" ]
[]
false
false
false
false
false
let v_of_typ (t: base_typ) (v: base_typ_as_vale_type t) : base_typ_as_type t =
match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.buffer_length
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t))
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 85, "end_line": 78, "start_col": 0, "start_line": 78 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h))
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b: Vale.PPC64LE.Memory.buffer t -> Prims.GTot Prims.nat
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.buffer", "LowStar.BufferView.Up.length", "Vale.Interop.Types.base_typ_as_type", "LowStar.BufferView.Up.mk_buffer", "FStar.UInt8.t", "Vale.Interop.Types.get_downview", "Vale.Interop.Types.__proj__Buffer__item__src", "Vale.Interop.Types.b8_preorder", "Vale.Interop.Types.__proj__Buffer__item__writeable", "Vale.Interop.Types.__proj__Buffer__item__bsrc", "Vale.PPC64LE.Memory.uint_view", "Prims.nat" ]
[]
false
false
false
false
false
let buffer_length #t b =
UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t))
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.uints64_from_felem_le
val uints64_from_felem_le: #w:lanes -> f:felem w -> Stack (uint64 & uint64) (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1)) (ensures fun h0 (lo, hi) h1 -> h0 == h1 /\ v hi * pow2 64 + v lo == (fas_nat h0 f).[0] % pow2 128)
val uints64_from_felem_le: #w:lanes -> f:felem w -> Stack (uint64 & uint64) (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1)) (ensures fun h0 (lo, hi) h1 -> h0 == h1 /\ v hi * pow2 64 + v lo == (fas_nat h0 f).[0] % pow2 128)
let uints64_from_felem_le #w f = let (f0, f1, f2, f3, f4) = (f.(0ul), f.(1ul), f.(2ul), f.(3ul), f.(4ul)) in store_felem5 #w (f0, f1, f2, f3, f4)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 38, "end_line": 712, "start_col": 0, "start_line": 710 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #push-options "--max_fuel 1" inline_for_extraction noextract val fmul_r: #w:lanes -> out:felem w -> f1:felem w -> r:felem w -> r5:felem w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h r /\ live h r5 /\ felem_fits h f1 (3,3,3,3,3) /\ felem_fits h r (2,2,2,2,2) /\ felem_fits h r5 (10,10,10,10,10) /\ as_tup5 h r5 == precomp_r5 (as_tup5 h r)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) let fmul_r #w out f1 r r5 = let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let (o0, o1, o2, o3, o4) = fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #pop-options inline_for_extraction noextract val fadd_mul_r: #w:lanes -> acc:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h acc /\ live h f1 /\ live h p /\ felem_fits h acc (2,2,2,2,2) /\ felem_fits h f1 (1,1,1,1,1) /\ fmul_precomp_r_pre h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (1,2,1,1,2) /\ feval h1 acc == LSeq.map2 (Vec.pfmul) (LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) let fadd_mul_r #w out f1 p = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let a0 = out.(0ul) in let a1 = out.(1ul) in let a2 = out.(2ul) in let a3 = out.(3ul) in let a4 = out.(4ul) in let (o0, o1, o2, o3, o4) = fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 inline_for_extraction noextract val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) let fmul_rn #w out f1 p = let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5 inline_for_extraction noextract val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (fas_nat h1 f).[0] == (feval h0 f).[0]) let reduce_felem #w f = let f0 = f.(0ul) in let f1 = f.(1ul) in let f2 = f.(2ul) in let f3 = f.(3ul) in let f4 = f.(4ul) in let (f0, f1, f2, f3, f4) = reduce_felem5 (f0, f1, f2, f3, f4) in f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 inline_for_extraction noextract val precompute_shift_reduce: #w:lanes -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2)) let precompute_shift_reduce #w f1 f2 = let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in f1.(0ul) <- vec_smul_mod f20 (u64 5); f1.(1ul) <- vec_smul_mod f21 (u64 5); f1.(2ul) <- vec_smul_mod f22 (u64 5); f1.(3ul) <- vec_smul_mod f23 (u64 5); f1.(4ul) <- vec_smul_mod f24 (u64 5) inline_for_extraction noextract val load_felem: #w:lanes -> f:felem w -> lo:uint64xN w -> hi:uint64xN w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == LSeq.createi #Vec.pfelem w (fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i])) let load_felem #w f lo hi = let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in load_felem5_lemma #w lo hi; f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 #push-options "--max_fuel 2" inline_for_extraction noextract val load_precompute_r1: p:precomp_r 1 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r1 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 1 in let r_vec1 = vec_load r1 1 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; copy_felem #_ #(1,1,1,1,1) rn r; copy_felem #_ #(5,5,5,5,5) rn_5 r5 inline_for_extraction noextract val load_precompute_r2: p:precomp_r 2 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r2 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 2 in let r_vec1 = vec_load r1 2 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; let h2 = ST.get () in fmul_r rn r r r5; let h3 = ST.get () in LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]); precompute_shift_reduce rn_5 rn inline_for_extraction noextract val load_precompute_r4: p:precomp_r 4 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r4 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 4 in let r_vec1 = vec_load r1 4 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; fmul_r rn r r r5; precompute_shift_reduce rn_5 rn; fmul_r rn rn rn rn_5; let h3 = ST.get () in LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]); precompute_shift_reduce rn_5 rn inline_for_extraction noextract val load_precompute_r: #w:lanes -> p:precomp_r w -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post #w h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create w (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r #w p r0 r1 = match w with | 1 -> load_precompute_r1 p r0 r1 | 2 -> load_precompute_r2 p r0 r1 | 4 -> load_precompute_r4 p r0 r1 #pop-options inline_for_extraction noextract val load_felem1_le: f:felem 1 -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem1 (as_seq h0 b)) let load_felem1_le f b = let h0 = ST.get () in let lo = vec_load_le U64 1 (sub b 0ul 8ul) in let hi = vec_load_le U64 1 (sub b 8ul 8ul) in load_felem f lo hi; let h1 = ST.get () in uints_from_bytes_le_lemma64_1 (as_seq h0 b); LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b)) inline_for_extraction noextract val load_felem2_le: f:felem 2 -> b:lbuffer uint8 32ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem2 (as_seq h0 b)) let load_felem2_le f b = let h0 = ST.get () in let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in let lo = vec_interleave_low b1 b2 in let hi = vec_interleave_high b1 b2 in load_felem f lo hi; let h1 = ST.get () in vec_interleave_low_lemma2 b1 b2; vec_interleave_high_lemma2 b1 b2; uints_from_bytes_le_lemma64_2 (as_seq h0 b); LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b)) inline_for_extraction noextract val load_felem4_le: f:felem 4 -> b:lbuffer uint8 64ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem4 (as_seq h0 b)) let load_felem4_le f b = let h0 = ST.get () in let lo = vec_load_le U64 4 (sub b 0ul 32ul) in let hi = vec_load_le U64 4 (sub b 32ul 32ul) in let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in load_felem5_le (as_seq h0 b); f.(0ul) <- o0; f.(1ul) <- o1; f.(2ul) <- o2; f.(3ul) <- o3; f.(4ul) <- o4 inline_for_extraction noextract val load_felems_le: #w:lanes -> f:felem w -> b:lbuffer uint8 (size w *! 16ul) -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem (as_seq h0 b)) let load_felems_le #w f b = match w with | 1 -> load_felem1_le f b | 2 -> load_felem2_le f b | 4 -> load_felem4_le f b inline_for_extraction noextract val load_blocks: #w:lanes -> f:felem w -> b:lbuffer uint8 (size w *! 16ul) -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == Vec.load_blocks #w (as_seq h0 b)) let load_blocks #s f b = load_felems_le f b; set_bit128 f inline_for_extraction noextract val load_felem_le: #w:lanes -> f:felem w -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b))) let load_felem_le #w f b = let lo = uint_from_bytes_le #U64 (sub b 0ul 8ul) in let hi = uint_from_bytes_le #U64 (sub b 8ul 8ul) in let f0 = vec_load lo w in let f1 = vec_load hi w in let h0 = ST.get () in load_felem f f0 f1; let h1 = ST.get () in uint_from_bytes_le_lemma (as_seq h0 b); LSeq.eq_intro (feval h1 f) (LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b))) inline_for_extraction noextract val uints64_from_felem_le: #w:lanes -> f:felem w -> Stack (uint64 & uint64) (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1)) (ensures fun h0 (lo, hi) h1 -> h0 == h1 /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack (Lib.IntTypes.uint64 * Lib.IntTypes.uint64)
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "Hacl.Spec.Poly1305.Field32xN.store_felem5", "FStar.Pervasives.Native.Mktuple5", "FStar.Pervasives.Native.tuple2", "Lib.IntTypes.uint64", "FStar.Pervasives.Native.tuple5", "Lib.Buffer.op_Array_Access", "Lib.Buffer.MUT", "FStar.UInt32.__uint_to_t" ]
[]
false
true
false
false
false
let uints64_from_felem_le #w f =
let f0, f1, f2, f3, f4 = (f.(0ul), f.(1ul), f.(2ul), f.(3ul), f.(4ul)) in store_felem5 #w (f0, f1, f2, f3, f4)
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.uint_view
val uint_view (t: base_typ) : (v: UV.view UInt8.t (IB.base_typ_as_type t) {UV.View?.n v == view_n t})
val uint_view (t: base_typ) : (v: UV.view UInt8.t (IB.base_typ_as_type t) {UV.View?.n v == view_n t})
let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 28, "end_line": 70, "start_col": 0, "start_line": 64 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t: Vale.Arch.HeapTypes_s.base_typ -> v: LowStar.BufferView.Up.view FStar.UInt8.t (Vale.Interop.Types.base_typ_as_type t) {View?.n v == Vale.Interop.Types.view_n t}
Prims.Tot
[ "total" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.uint8_view", "Vale.PPC64LE.Memory.uint16_view", "Vale.PPC64LE.Memory.uint32_view", "Vale.PPC64LE.Memory.uint64_view", "Vale.PPC64LE.Memory.uint128_view", "LowStar.BufferView.Up.view", "FStar.UInt8.t", "Vale.Interop.Types.base_typ_as_type", "Prims.eq2", "Prims.pos", "LowStar.BufferView.Up.__proj__View__item__n", "Vale.Interop.Types.view_n" ]
[]
false
false
false
false
false
let uint_view (t: base_typ) : (v: UV.view UInt8.t (IB.base_typ_as_type t) {UV.View?.n v == view_n t}) =
match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.v_to_typ
val v_to_typ (t: base_typ) (v: base_typ_as_type t) : base_typ_as_vale_type t
val v_to_typ (t: base_typ) (v: base_typ_as_type t) : base_typ_as_vale_type t
let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 17, "end_line": 50, "start_col": 0, "start_line": 44 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t: Vale.Arch.HeapTypes_s.base_typ -> v: Vale.Interop.Types.base_typ_as_type t -> Vale.PPC64LE.Memory.base_typ_as_vale_type t
Prims.Tot
[ "total" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.Interop.Types.base_typ_as_type", "FStar.UInt8.v", "FStar.UInt16.v", "FStar.UInt32.v", "FStar.UInt64.v", "Vale.PPC64LE.Memory.base_typ_as_vale_type" ]
[]
false
false
false
false
false
let v_to_typ (t: base_typ) (v: base_typ_as_type t) : base_typ_as_vale_type t =
match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.precompute_shift_reduce
val precompute_shift_reduce: #w:lanes -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
val precompute_shift_reduce: #w:lanes -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 = let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in f1.(0ul) <- vec_smul_mod f20 (u64 5); f1.(1ul) <- vec_smul_mod f21 (u64 5); f1.(2ul) <- vec_smul_mod f22 (u64 5); f1.(3ul) <- vec_smul_mod f23 (u64 5); f1.(4ul) <- vec_smul_mod f24 (u64 5)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 38, "end_line": 416, "start_col": 0, "start_line": 406 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #push-options "--max_fuel 1" inline_for_extraction noextract val fmul_r: #w:lanes -> out:felem w -> f1:felem w -> r:felem w -> r5:felem w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h r /\ live h r5 /\ felem_fits h f1 (3,3,3,3,3) /\ felem_fits h r (2,2,2,2,2) /\ felem_fits h r5 (10,10,10,10,10) /\ as_tup5 h r5 == precomp_r5 (as_tup5 h r)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) let fmul_r #w out f1 r r5 = let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let (o0, o1, o2, o3, o4) = fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #pop-options inline_for_extraction noextract val fadd_mul_r: #w:lanes -> acc:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h acc /\ live h f1 /\ live h p /\ felem_fits h acc (2,2,2,2,2) /\ felem_fits h f1 (1,1,1,1,1) /\ fmul_precomp_r_pre h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (1,2,1,1,2) /\ feval h1 acc == LSeq.map2 (Vec.pfmul) (LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) let fadd_mul_r #w out f1 p = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let a0 = out.(0ul) in let a1 = out.(1ul) in let a2 = out.(2ul) in let a3 = out.(3ul) in let a4 = out.(4ul) in let (o0, o1, o2, o3, o4) = fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 inline_for_extraction noextract val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) let fmul_rn #w out f1 p = let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5 inline_for_extraction noextract val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (fas_nat h1 f).[0] == (feval h0 f).[0]) let reduce_felem #w f = let f0 = f.(0ul) in let f1 = f.(1ul) in let f2 = f.(2ul) in let f3 = f.(3ul) in let f4 = f.(4ul) in let (f0, f1, f2, f3, f4) = reduce_felem5 (f0, f1, f2, f3, f4) in f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 inline_for_extraction noextract val precompute_shift_reduce: #w:lanes -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f1: Hacl.Impl.Poly1305.Field32xN.felem w -> f2: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Lib.Buffer.op_Array_Assignment", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.__uint_to_t", "Lib.IntVector.vec_smul_mod", "Lib.IntTypes.U64", "Lib.IntTypes.u64", "Prims.unit", "Lib.Buffer.op_Array_Access", "Lib.Buffer.MUT" ]
[]
false
true
false
false
false
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in f1.(0ul) <- vec_smul_mod f20 (u64 5); f1.(1ul) <- vec_smul_mod f21 (u64 5); f1.(2ul) <- vec_smul_mod f22 (u64 5); f1.(3ul) <- vec_smul_mod f23 (u64 5); f1.(4ul) <- vec_smul_mod f24 (u64 5)
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.buffer_as_seq
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 40, "end_line": 74, "start_col": 0, "start_line": 72 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: Vale.Arch.HeapImpl.vale_heap -> b: Vale.PPC64LE.Memory.buffer t -> Prims.GTot (FStar.Seq.Base.seq (Vale.PPC64LE.Memory.base_typ_as_vale_type t))
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.Arch.HeapImpl.vale_heap", "Vale.PPC64LE.Memory.buffer", "Vale.Lib.Seqs_s.seq_map", "Vale.Interop.Types.base_typ_as_type", "Vale.PPC64LE.Memory.base_typ_as_vale_type", "Vale.PPC64LE.Memory.v_to_typ", "FStar.Seq.Properties.lseq", "LowStar.BufferView.Up.length", "LowStar.BufferView.Up.mk_buffer", "FStar.UInt8.t", "Vale.Interop.Types.get_downview", "Vale.Interop.Types.__proj__Buffer__item__src", "Vale.Interop.Types.b8_preorder", "Vale.Interop.Types.__proj__Buffer__item__writeable", "Vale.Interop.Types.__proj__Buffer__item__bsrc", "Vale.PPC64LE.Memory.uint_view", "LowStar.BufferView.Up.as_seq", "Vale.Interop.Heap_s.hs_of_mem", "Vale.Arch.HeapImpl._ih", "FStar.Seq.Base.seq" ]
[]
false
false
false
false
false
let buffer_as_seq #t h b =
let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.set_zero
val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0)
val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0)
let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 46, "end_line": 185, "start_col": 0, "start_line": 178 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Lib.Sequence.eq_intro", "Hacl.Spec.Poly1305.Vec.pfelem", "Hacl.Impl.Poly1305.Field32xN.feval", "Lib.Sequence.create", "Prims.unit", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Lib.Buffer.op_Array_Assignment", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "FStar.UInt32.__uint_to_t", "Hacl.Spec.Poly1305.Field32xN.zero" ]
[]
false
true
false
false
false
let set_zero #w f =
f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.reduce_felem
val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (fas_nat h1 f).[0] == (feval h0 f).[0])
val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f = let f0 = f.(0ul) in let f1 = f.(1ul) in let f2 = f.(2ul) in let f3 = f.(3ul) in let f4 = f.(4ul) in let (f0, f1, f2, f3, f4) = reduce_felem5 (f0, f1, f2, f3, f4) in f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.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": 382 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #push-options "--max_fuel 1" inline_for_extraction noextract val fmul_r: #w:lanes -> out:felem w -> f1:felem w -> r:felem w -> r5:felem w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h r /\ live h r5 /\ felem_fits h f1 (3,3,3,3,3) /\ felem_fits h r (2,2,2,2,2) /\ felem_fits h r5 (10,10,10,10,10) /\ as_tup5 h r5 == precomp_r5 (as_tup5 h r)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) let fmul_r #w out f1 r r5 = let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let (o0, o1, o2, o3, o4) = fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #pop-options inline_for_extraction noextract val fadd_mul_r: #w:lanes -> acc:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h acc /\ live h f1 /\ live h p /\ felem_fits h acc (2,2,2,2,2) /\ felem_fits h f1 (1,1,1,1,1) /\ fmul_precomp_r_pre h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (1,2,1,1,2) /\ feval h1 acc == LSeq.map2 (Vec.pfmul) (LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) let fadd_mul_r #w out f1 p = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let a0 = out.(0ul) in let a1 = out.(1ul) in let a2 = out.(2ul) in let a3 = out.(3ul) in let a4 = out.(4ul) in let (o0, o1, o2, o3, o4) = fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 inline_for_extraction noextract val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) let fmul_rn #w out f1 p = let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5 inline_for_extraction noextract val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "Lib.Buffer.op_Array_Assignment", "FStar.UInt32.__uint_to_t", "Prims.unit", "Hacl.Spec.Poly1305.Field32xN.felem5", "Hacl.Spec.Poly1305.Field32xN.reduce_felem5", "FStar.Pervasives.Native.Mktuple5", "Lib.Buffer.op_Array_Access", "Lib.Buffer.MUT" ]
[]
false
true
false
false
false
let reduce_felem #w f =
let f0 = f.(0ul) in let f1 = f.(1ul) in let f2 = f.(2ul) in let f3 = f.(3ul) in let f4 = f.(4ul) in let f0, f1, f2, f3, f4 = reduce_felem5 (f0, f1, f2, f3, f4) in f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.fadd
val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 17, "end_line": 241, "start_col": 0, "start_line": 224 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
out: Hacl.Impl.Poly1305.Field32xN.felem w -> f1: Hacl.Impl.Poly1305.Field32xN.felem w -> f2: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Hacl.Spec.Poly1305.Field32xN.uint64xN", "Lib.Buffer.op_Array_Assignment", "FStar.UInt32.__uint_to_t", "Prims.unit", "Hacl.Spec.Poly1305.Field32xN.felem5", "Hacl.Spec.Poly1305.Field32xN.fadd5", "FStar.Pervasives.Native.Mktuple5", "Lib.Buffer.op_Array_Access", "Lib.Buffer.MUT" ]
[]
false
true
false
false
false
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let o0, o1, o2, o3, o4 = fadd5 #w (f10, f11, f12, f13, f14) (f20, f21, f22, f23, f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.modifies
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 42, "end_line": 90, "start_col": 0, "start_line": 85 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 2, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Vale.PPC64LE.Memory.loc -> h1: Vale.Arch.HeapImpl.vale_heap -> h2: Vale.Arch.HeapImpl.vale_heap -> Prims.GTot Vale.Def.Prop_s.prop0
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.PPC64LE.Memory.loc", "Vale.Arch.HeapImpl.vale_heap", "Prims.l_and", "LowStar.Monotonic.Buffer.modifies", "Vale.Interop.Heap_s.__proj__InteropHeap__item__hs", "Vale.Arch.HeapImpl._ih", "Prims.eq2", "FStar.Pervasives.Native.option", "Vale.Arch.HeapImpl.heaplet_id", "Vale.Arch.HeapImpl.__proj__ValeHeap__item__heapletId", "Prims.list", "Vale.Interop.Types.b8", "Prims.l_or", "Vale.Interop.Heap_s.list_disjoint_or_eq", "Vale.Interop.Heap_s.__proj__InteropHeap__item__ptrs", "Vale.Interop.Types.addr_map", "Vale.Interop.Heap_s.mk_addr_map", "Vale.Interop.Heap_s.__proj__InteropHeap__item__addrs", "FStar.HyperStack.ST.equal_domains", "Vale.Def.Prop_s.prop0" ]
[]
false
false
false
false
false
let modifies s h h' =
M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.valid_offset
val valid_offset : t: Vale.Arch.HeapTypes_s.base_typ -> n: Prims.nat -> base: Prims.nat -> addr: Prims.int -> i: Prims.nat -> Prims.logical
let valid_offset (t:base_typ) (n base:nat) (addr:int) (i:nat) = exists j.{:pattern (scale_t t j)} i <= j /\ j < n /\ base + scale_t t j == addr
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 81, "end_line": 330, "start_col": 0, "start_line": 329 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2 let loc_includes_refl s = M.loc_includes_refl s let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3 let loc_includes_union_r s s1 s2 = M.loc_includes_union_r s s1 s2 let loc_includes_union_l s1 s2 s = M.loc_includes_union_l s1 s2 s let loc_includes_union_l_buffer #t s1 s2 b = M.loc_includes_union_l s1 s2 (loc_buffer b) let loc_includes_none s = M.loc_includes_none s let modifies_refl s h = M.modifies_refl s (_ih h).hs let modifies_goal_directed_refl s h = M.modifies_refl s (_ih h).hs let modifies_loc_includes s1 h h' s2 = M.modifies_loc_includes s1 (_ih h).hs (_ih h').hs s2 let modifies_trans s12 h1 h2 s23 h3 = M.modifies_trans s12 (_ih h1).hs (_ih h2).hs s23 (_ih h3).hs let modifies_goal_directed_trans s12 h1 h2 s13 h3 = modifies_trans s12 h1 h2 s13 h3; modifies_loc_includes s13 h1 h3 (loc_union s12 s13); () let modifies_goal_directed_trans2 s12 h1 h2 s13 h3 = modifies_goal_directed_trans s12 h1 h2 s13 h3 let default_of_typ (t:base_typ) : base_typ_as_vale_type t = allow_inversion base_typ; match t with | TUInt8 -> 0 | TUInt16 -> 0 | TUInt32 -> 0 | TUInt64 -> 0 | TUInt128 -> Vale.Def.Words_s.Mkfour #nat32 0 0 0 0 let buffer_read #t b i h = if i < 0 || i >= buffer_length b then default_of_typ t else Seq.index (buffer_as_seq h b) i let seq_upd (#b:_) (h:HS.mem) (vb:UV.buffer b{UV.live h vb}) (i:nat{i < UV.length vb}) (x:b) : Lemma (Seq.equal (Seq.upd (UV.as_seq h vb) i x) (UV.as_seq (UV.upd h vb i x) vb)) = let old_s = UV.as_seq h vb in let new_s = UV.as_seq (UV.upd h vb i x) vb in let upd_s = Seq.upd old_s i x in let rec aux (k:nat) : Lemma (requires (k <= Seq.length upd_s /\ (forall (j:nat). j < k ==> Seq.index upd_s j == Seq.index new_s j))) (ensures (forall (j:nat). j < Seq.length upd_s ==> Seq.index upd_s j == Seq.index new_s j)) (decreases %[(Seq.length upd_s) - k]) = if k = Seq.length upd_s then () else begin UV.sel_upd vb i k x h; UV.as_seq_sel h vb k; UV.as_seq_sel (UV.upd h vb i x) vb k; aux (k+1) end in aux 0 let buffer_write #t b i v h = if i < 0 || i >= buffer_length b then h else begin let view = uint_view t in let db = get_downview b.bsrc in let bv = UV.mk_buffer db view in UV.upd_modifies (_ih h).hs bv i (v_of_typ t v); UV.upd_equal_domains (_ih h).hs bv i (v_of_typ t v); let hs' = UV.upd (_ih h).hs bv i (v_of_typ t v) in let ih' = InteropHeap (_ih h).ptrs (_ih h).addrs hs' in let mh' = Vale.Interop.down_mem ih' in let h':vale_heap = ValeHeap mh' (Ghost.hide ih') h.heapletId in seq_upd (_ih h).hs bv i (v_of_typ t v); assert (Seq.equal (buffer_as_seq h' b) (Seq.upd (buffer_as_seq h b) i v)); h' end unfold let scale_t (t:base_typ) (index:int) : int = scale_by (view_n t) index // Checks if address addr corresponds to one of the elements of buffer ptr let addr_in_ptr (#t:base_typ) (addr:int) (ptr:buffer t) (h:vale_heap) : Ghost bool (requires True) (ensures fun b -> not b <==> (forall (i:int).{:pattern (scale_t t i)} 0 <= i /\ i < buffer_length ptr ==> addr <> (buffer_addr ptr h) + scale_t t i)) = let n = buffer_length ptr in let base = buffer_addr ptr h in let rec aux (i:nat) : Tot (b:bool{not b <==> (forall j. i <= j /\ j < n ==> addr <> base + scale_t t j)}) (decreases %[n-i]) = if i >= n then false else if addr = base + scale_t t i then true else aux (i+1) in aux 0
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t: Vale.Arch.HeapTypes_s.base_typ -> n: Prims.nat -> base: Prims.nat -> addr: Prims.int -> i: Prims.nat -> Prims.logical
Prims.Tot
[ "total" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Prims.nat", "Prims.int", "Prims.l_Exists", "Prims.l_and", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_LessThan", "Prims.eq2", "Prims.op_Addition", "Vale.PPC64LE.Memory.scale_t", "Prims.logical" ]
[]
false
false
false
true
true
let valid_offset (t: base_typ) (n base: nat) (addr: int) (i: nat) =
exists j. {:pattern (scale_t t j)} i <= j /\ j < n /\ base + scale_t t j == addr
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_disjoint_none_r
val loc_disjoint_none_r (s:loc) : Lemma (ensures (loc_disjoint s loc_none)) [SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_none_r (s:loc) : Lemma (ensures (loc_disjoint s loc_none)) [SMTPat (loc_disjoint s loc_none)]
let loc_disjoint_none_r s = M.loc_disjoint_none_r s
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 51, "end_line": 233, "start_col": 0, "start_line": 233 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = ()
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Vale.PPC64LE.Memory.loc -> FStar.Pervasives.Lemma (ensures Vale.PPC64LE.Memory.loc_disjoint s Vale.PPC64LE.Memory.loc_none) [SMTPat (Vale.PPC64LE.Memory.loc_disjoint s Vale.PPC64LE.Memory.loc_none)]
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.PPC64LE.Memory.loc", "LowStar.Monotonic.Buffer.loc_disjoint_none_r", "Prims.unit" ]
[]
true
false
true
false
false
let loc_disjoint_none_r s =
M.loc_disjoint_none_r s
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_includes_refl
val loc_includes_refl (s:loc) : Lemma (loc_includes s s) [SMTPat (loc_includes s s)]
val loc_includes_refl (s:loc) : Lemma (loc_includes s s) [SMTPat (loc_includes s s)]
let loc_includes_refl s = M.loc_includes_refl s
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 47, "end_line": 235, "start_col": 0, "start_line": 235 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Vale.PPC64LE.Memory.loc -> FStar.Pervasives.Lemma (ensures Vale.PPC64LE.Memory.loc_includes s s) [SMTPat (Vale.PPC64LE.Memory.loc_includes s s)]
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.PPC64LE.Memory.loc", "LowStar.Monotonic.Buffer.loc_includes_refl", "Prims.unit" ]
[]
true
false
true
false
false
let loc_includes_refl s =
M.loc_includes_refl s
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.scale_t
val scale_t (t: base_typ) (index: int) : int
val scale_t (t: base_typ) (index: int) : int
let scale_t (t:base_typ) (index:int) : int = scale_by (view_n t) index
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 77, "end_line": 310, "start_col": 7, "start_line": 310 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2 let loc_includes_refl s = M.loc_includes_refl s let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3 let loc_includes_union_r s s1 s2 = M.loc_includes_union_r s s1 s2 let loc_includes_union_l s1 s2 s = M.loc_includes_union_l s1 s2 s let loc_includes_union_l_buffer #t s1 s2 b = M.loc_includes_union_l s1 s2 (loc_buffer b) let loc_includes_none s = M.loc_includes_none s let modifies_refl s h = M.modifies_refl s (_ih h).hs let modifies_goal_directed_refl s h = M.modifies_refl s (_ih h).hs let modifies_loc_includes s1 h h' s2 = M.modifies_loc_includes s1 (_ih h).hs (_ih h').hs s2 let modifies_trans s12 h1 h2 s23 h3 = M.modifies_trans s12 (_ih h1).hs (_ih h2).hs s23 (_ih h3).hs let modifies_goal_directed_trans s12 h1 h2 s13 h3 = modifies_trans s12 h1 h2 s13 h3; modifies_loc_includes s13 h1 h3 (loc_union s12 s13); () let modifies_goal_directed_trans2 s12 h1 h2 s13 h3 = modifies_goal_directed_trans s12 h1 h2 s13 h3 let default_of_typ (t:base_typ) : base_typ_as_vale_type t = allow_inversion base_typ; match t with | TUInt8 -> 0 | TUInt16 -> 0 | TUInt32 -> 0 | TUInt64 -> 0 | TUInt128 -> Vale.Def.Words_s.Mkfour #nat32 0 0 0 0 let buffer_read #t b i h = if i < 0 || i >= buffer_length b then default_of_typ t else Seq.index (buffer_as_seq h b) i let seq_upd (#b:_) (h:HS.mem) (vb:UV.buffer b{UV.live h vb}) (i:nat{i < UV.length vb}) (x:b) : Lemma (Seq.equal (Seq.upd (UV.as_seq h vb) i x) (UV.as_seq (UV.upd h vb i x) vb)) = let old_s = UV.as_seq h vb in let new_s = UV.as_seq (UV.upd h vb i x) vb in let upd_s = Seq.upd old_s i x in let rec aux (k:nat) : Lemma (requires (k <= Seq.length upd_s /\ (forall (j:nat). j < k ==> Seq.index upd_s j == Seq.index new_s j))) (ensures (forall (j:nat). j < Seq.length upd_s ==> Seq.index upd_s j == Seq.index new_s j)) (decreases %[(Seq.length upd_s) - k]) = if k = Seq.length upd_s then () else begin UV.sel_upd vb i k x h; UV.as_seq_sel h vb k; UV.as_seq_sel (UV.upd h vb i x) vb k; aux (k+1) end in aux 0 let buffer_write #t b i v h = if i < 0 || i >= buffer_length b then h else begin let view = uint_view t in let db = get_downview b.bsrc in let bv = UV.mk_buffer db view in UV.upd_modifies (_ih h).hs bv i (v_of_typ t v); UV.upd_equal_domains (_ih h).hs bv i (v_of_typ t v); let hs' = UV.upd (_ih h).hs bv i (v_of_typ t v) in let ih' = InteropHeap (_ih h).ptrs (_ih h).addrs hs' in let mh' = Vale.Interop.down_mem ih' in let h':vale_heap = ValeHeap mh' (Ghost.hide ih') h.heapletId in seq_upd (_ih h).hs bv i (v_of_typ t v); assert (Seq.equal (buffer_as_seq h' b) (Seq.upd (buffer_as_seq h b) i v)); h' end
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t: Vale.Arch.HeapTypes_s.base_typ -> index: Prims.int -> Prims.int
Prims.Tot
[ "total" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Prims.int", "Vale.PPC64LE.Memory.scale_by", "Vale.Interop.Types.view_n" ]
[]
false
false
false
true
false
let scale_t (t: base_typ) (index: int) : int =
scale_by (view_n t) index
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_disjoint_union_r
val loc_disjoint_union_r (s s1 s2:loc) : Lemma (requires (loc_disjoint s s1 /\ loc_disjoint s s2)) (ensures (loc_disjoint s (loc_union s1 s2))) [SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma (requires (loc_disjoint s s1 /\ loc_disjoint s s2)) (ensures (loc_disjoint s (loc_union s1 s2))) [SMTPat (loc_disjoint s (loc_union s1 s2))]
let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 65, "end_line": 234, "start_col": 0, "start_line": 234 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = ()
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Vale.PPC64LE.Memory.loc -> s1: Vale.PPC64LE.Memory.loc -> s2: Vale.PPC64LE.Memory.loc -> FStar.Pervasives.Lemma (requires Vale.PPC64LE.Memory.loc_disjoint s s1 /\ Vale.PPC64LE.Memory.loc_disjoint s s2) (ensures Vale.PPC64LE.Memory.loc_disjoint s (Vale.PPC64LE.Memory.loc_union s1 s2)) [SMTPat (Vale.PPC64LE.Memory.loc_disjoint s (Vale.PPC64LE.Memory.loc_union s1 s2))]
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.PPC64LE.Memory.loc", "LowStar.Monotonic.Buffer.loc_disjoint_union_r", "Prims.unit" ]
[]
true
false
true
false
false
let loc_disjoint_union_r s s1 s2 =
M.loc_disjoint_union_r s s1 s2
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.writeable_buffer
val writeable_buffer (t: base_typ) (addr: int) (b: b8) (h: vale_heap) : GTot bool
val writeable_buffer (t: base_typ) (addr: int) (b: b8) (h: vale_heap) : GTot bool
let writeable_buffer (t:base_typ) (addr:int) (b:b8) (h:vale_heap) : GTot bool = valid_buffer t addr b h && b.writeable
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 40, "end_line": 345, "start_col": 0, "start_line": 344 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2 let loc_includes_refl s = M.loc_includes_refl s let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3 let loc_includes_union_r s s1 s2 = M.loc_includes_union_r s s1 s2 let loc_includes_union_l s1 s2 s = M.loc_includes_union_l s1 s2 s let loc_includes_union_l_buffer #t s1 s2 b = M.loc_includes_union_l s1 s2 (loc_buffer b) let loc_includes_none s = M.loc_includes_none s let modifies_refl s h = M.modifies_refl s (_ih h).hs let modifies_goal_directed_refl s h = M.modifies_refl s (_ih h).hs let modifies_loc_includes s1 h h' s2 = M.modifies_loc_includes s1 (_ih h).hs (_ih h').hs s2 let modifies_trans s12 h1 h2 s23 h3 = M.modifies_trans s12 (_ih h1).hs (_ih h2).hs s23 (_ih h3).hs let modifies_goal_directed_trans s12 h1 h2 s13 h3 = modifies_trans s12 h1 h2 s13 h3; modifies_loc_includes s13 h1 h3 (loc_union s12 s13); () let modifies_goal_directed_trans2 s12 h1 h2 s13 h3 = modifies_goal_directed_trans s12 h1 h2 s13 h3 let default_of_typ (t:base_typ) : base_typ_as_vale_type t = allow_inversion base_typ; match t with | TUInt8 -> 0 | TUInt16 -> 0 | TUInt32 -> 0 | TUInt64 -> 0 | TUInt128 -> Vale.Def.Words_s.Mkfour #nat32 0 0 0 0 let buffer_read #t b i h = if i < 0 || i >= buffer_length b then default_of_typ t else Seq.index (buffer_as_seq h b) i let seq_upd (#b:_) (h:HS.mem) (vb:UV.buffer b{UV.live h vb}) (i:nat{i < UV.length vb}) (x:b) : Lemma (Seq.equal (Seq.upd (UV.as_seq h vb) i x) (UV.as_seq (UV.upd h vb i x) vb)) = let old_s = UV.as_seq h vb in let new_s = UV.as_seq (UV.upd h vb i x) vb in let upd_s = Seq.upd old_s i x in let rec aux (k:nat) : Lemma (requires (k <= Seq.length upd_s /\ (forall (j:nat). j < k ==> Seq.index upd_s j == Seq.index new_s j))) (ensures (forall (j:nat). j < Seq.length upd_s ==> Seq.index upd_s j == Seq.index new_s j)) (decreases %[(Seq.length upd_s) - k]) = if k = Seq.length upd_s then () else begin UV.sel_upd vb i k x h; UV.as_seq_sel h vb k; UV.as_seq_sel (UV.upd h vb i x) vb k; aux (k+1) end in aux 0 let buffer_write #t b i v h = if i < 0 || i >= buffer_length b then h else begin let view = uint_view t in let db = get_downview b.bsrc in let bv = UV.mk_buffer db view in UV.upd_modifies (_ih h).hs bv i (v_of_typ t v); UV.upd_equal_domains (_ih h).hs bv i (v_of_typ t v); let hs' = UV.upd (_ih h).hs bv i (v_of_typ t v) in let ih' = InteropHeap (_ih h).ptrs (_ih h).addrs hs' in let mh' = Vale.Interop.down_mem ih' in let h':vale_heap = ValeHeap mh' (Ghost.hide ih') h.heapletId in seq_upd (_ih h).hs bv i (v_of_typ t v); assert (Seq.equal (buffer_as_seq h' b) (Seq.upd (buffer_as_seq h b) i v)); h' end unfold let scale_t (t:base_typ) (index:int) : int = scale_by (view_n t) index // Checks if address addr corresponds to one of the elements of buffer ptr let addr_in_ptr (#t:base_typ) (addr:int) (ptr:buffer t) (h:vale_heap) : Ghost bool (requires True) (ensures fun b -> not b <==> (forall (i:int).{:pattern (scale_t t i)} 0 <= i /\ i < buffer_length ptr ==> addr <> (buffer_addr ptr h) + scale_t t i)) = let n = buffer_length ptr in let base = buffer_addr ptr h in let rec aux (i:nat) : Tot (b:bool{not b <==> (forall j. i <= j /\ j < n ==> addr <> base + scale_t t j)}) (decreases %[n-i]) = if i >= n then false else if addr = base + scale_t t i then true else aux (i+1) in aux 0 let valid_offset (t:base_typ) (n base:nat) (addr:int) (i:nat) = exists j.{:pattern (scale_t t j)} i <= j /\ j < n /\ base + scale_t t j == addr let rec get_addr_in_ptr (t:base_typ) (n base addr:nat) (i:nat) : Ghost nat (requires valid_offset t n base addr i) (ensures fun j -> base + scale_t t j == addr) (decreases %[n - i]) = if base + scale_t t i = addr then i else get_addr_in_ptr t n base addr (i + 1) let valid_buffer (t:base_typ) (addr:int) (b:b8) (h:vale_heap) : GTot bool = DV.length (get_downview b.bsrc) % (view_n t) = 0 && addr_in_ptr #t addr b h
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t: Vale.Arch.HeapTypes_s.base_typ -> addr: Prims.int -> b: Vale.PPC64LE.Memory.b8 -> h: Vale.Arch.HeapImpl.vale_heap -> Prims.GTot Prims.bool
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Prims.int", "Vale.PPC64LE.Memory.b8", "Vale.Arch.HeapImpl.vale_heap", "Prims.op_AmpAmp", "Vale.PPC64LE.Memory.valid_buffer", "Vale.Interop.Types.__proj__Buffer__item__writeable", "Prims.bool" ]
[]
false
false
false
false
false
let writeable_buffer (t: base_typ) (addr: int) (b: b8) (h: vale_heap) : GTot bool =
valid_buffer t addr b h && b.writeable
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.modifies_buffer_elim
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma (requires loc_disjoint (loc_buffer b) p /\ buffer_readable h b /\ modifies p h h' ) (ensures buffer_readable h b /\ buffer_readable h' b /\ buffer_as_seq h b == buffer_as_seq h' b ) [SMTPatOr [ [SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]; [SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)]; ]]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma (requires loc_disjoint (loc_buffer b) p /\ buffer_readable h b /\ modifies p h h' ) (ensures buffer_readable h b /\ buffer_readable h' b /\ buffer_as_seq h b == buffer_as_seq h' b ) [SMTPatOr [ [SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]; [SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)]; ]]
let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b))
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 61, "end_line": 228, "start_col": 0, "start_line": 224 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b: Vale.PPC64LE.Memory.buffer t1 -> p: Vale.PPC64LE.Memory.loc -> h: Vale.Arch.HeapImpl.vale_heap -> h': Vale.Arch.HeapImpl.vale_heap -> FStar.Pervasives.Lemma (requires Vale.PPC64LE.Memory.loc_disjoint (Vale.PPC64LE.Memory.loc_buffer b) p /\ Vale.PPC64LE.Memory.buffer_readable h b /\ Vale.PPC64LE.Memory.modifies p h h') (ensures Vale.PPC64LE.Memory.buffer_readable h b /\ Vale.PPC64LE.Memory.buffer_readable h' b /\ Vale.PPC64LE.Memory.buffer_as_seq h b == Vale.PPC64LE.Memory.buffer_as_seq h' b) [ SMTPatOr [ [ SMTPat (Vale.PPC64LE.Memory.modifies p h h'); SMTPat (Vale.PPC64LE.Memory.buffer_readable h' b) ]; [ SMTPat (Vale.PPC64LE.Memory.modifies p h h'); SMTPat (Vale.PPC64LE.Memory.buffer_as_seq h' b) ] ] ]
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "Vale.PPC64LE.Memory.buffer", "Vale.PPC64LE.Memory.loc", "Vale.Arch.HeapImpl.vale_heap", "Prims._assert", "FStar.Seq.Base.equal", "Vale.PPC64LE.Memory.base_typ_as_vale_type", "Vale.PPC64LE.Memory.buffer_as_seq", "Prims.unit", "Vale.PPC64LE.Memory.same_underlying_seq", "Vale.Lib.BufferViewHelpers.lemma_dv_equal", "Vale.Interop.Types.base_typ_as_type", "Vale.Interop.Types.__proj__Buffer__item__src", "Vale.Interop.Types.b8_preorder", "Vale.Interop.Types.__proj__Buffer__item__writeable", "FStar.UInt8.t", "Vale.Interop.Types.down_view", "Vale.Interop.Types.__proj__Buffer__item__bsrc", "Vale.Interop.Heap_s.__proj__InteropHeap__item__hs", "Vale.Arch.HeapImpl._ih", "LowStar.BufferView.Down.buffer", "Vale.Interop.Types.get_downview" ]
[]
true
false
true
false
false
let modifies_buffer_elim #t1 b p h h' =
let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b))
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.sub_list
val sub_list : p1: Prims.list 'a -> p2: Prims.list 'a -> Prims.logical
let sub_list (p1 p2:list 'a) = forall x. {:pattern List.memP x p2} List.memP x p1 ==> List.memP x p2
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 100, "end_line": 348, "start_col": 0, "start_line": 348 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2 let loc_includes_refl s = M.loc_includes_refl s let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3 let loc_includes_union_r s s1 s2 = M.loc_includes_union_r s s1 s2 let loc_includes_union_l s1 s2 s = M.loc_includes_union_l s1 s2 s let loc_includes_union_l_buffer #t s1 s2 b = M.loc_includes_union_l s1 s2 (loc_buffer b) let loc_includes_none s = M.loc_includes_none s let modifies_refl s h = M.modifies_refl s (_ih h).hs let modifies_goal_directed_refl s h = M.modifies_refl s (_ih h).hs let modifies_loc_includes s1 h h' s2 = M.modifies_loc_includes s1 (_ih h).hs (_ih h').hs s2 let modifies_trans s12 h1 h2 s23 h3 = M.modifies_trans s12 (_ih h1).hs (_ih h2).hs s23 (_ih h3).hs let modifies_goal_directed_trans s12 h1 h2 s13 h3 = modifies_trans s12 h1 h2 s13 h3; modifies_loc_includes s13 h1 h3 (loc_union s12 s13); () let modifies_goal_directed_trans2 s12 h1 h2 s13 h3 = modifies_goal_directed_trans s12 h1 h2 s13 h3 let default_of_typ (t:base_typ) : base_typ_as_vale_type t = allow_inversion base_typ; match t with | TUInt8 -> 0 | TUInt16 -> 0 | TUInt32 -> 0 | TUInt64 -> 0 | TUInt128 -> Vale.Def.Words_s.Mkfour #nat32 0 0 0 0 let buffer_read #t b i h = if i < 0 || i >= buffer_length b then default_of_typ t else Seq.index (buffer_as_seq h b) i let seq_upd (#b:_) (h:HS.mem) (vb:UV.buffer b{UV.live h vb}) (i:nat{i < UV.length vb}) (x:b) : Lemma (Seq.equal (Seq.upd (UV.as_seq h vb) i x) (UV.as_seq (UV.upd h vb i x) vb)) = let old_s = UV.as_seq h vb in let new_s = UV.as_seq (UV.upd h vb i x) vb in let upd_s = Seq.upd old_s i x in let rec aux (k:nat) : Lemma (requires (k <= Seq.length upd_s /\ (forall (j:nat). j < k ==> Seq.index upd_s j == Seq.index new_s j))) (ensures (forall (j:nat). j < Seq.length upd_s ==> Seq.index upd_s j == Seq.index new_s j)) (decreases %[(Seq.length upd_s) - k]) = if k = Seq.length upd_s then () else begin UV.sel_upd vb i k x h; UV.as_seq_sel h vb k; UV.as_seq_sel (UV.upd h vb i x) vb k; aux (k+1) end in aux 0 let buffer_write #t b i v h = if i < 0 || i >= buffer_length b then h else begin let view = uint_view t in let db = get_downview b.bsrc in let bv = UV.mk_buffer db view in UV.upd_modifies (_ih h).hs bv i (v_of_typ t v); UV.upd_equal_domains (_ih h).hs bv i (v_of_typ t v); let hs' = UV.upd (_ih h).hs bv i (v_of_typ t v) in let ih' = InteropHeap (_ih h).ptrs (_ih h).addrs hs' in let mh' = Vale.Interop.down_mem ih' in let h':vale_heap = ValeHeap mh' (Ghost.hide ih') h.heapletId in seq_upd (_ih h).hs bv i (v_of_typ t v); assert (Seq.equal (buffer_as_seq h' b) (Seq.upd (buffer_as_seq h b) i v)); h' end unfold let scale_t (t:base_typ) (index:int) : int = scale_by (view_n t) index // Checks if address addr corresponds to one of the elements of buffer ptr let addr_in_ptr (#t:base_typ) (addr:int) (ptr:buffer t) (h:vale_heap) : Ghost bool (requires True) (ensures fun b -> not b <==> (forall (i:int).{:pattern (scale_t t i)} 0 <= i /\ i < buffer_length ptr ==> addr <> (buffer_addr ptr h) + scale_t t i)) = let n = buffer_length ptr in let base = buffer_addr ptr h in let rec aux (i:nat) : Tot (b:bool{not b <==> (forall j. i <= j /\ j < n ==> addr <> base + scale_t t j)}) (decreases %[n-i]) = if i >= n then false else if addr = base + scale_t t i then true else aux (i+1) in aux 0 let valid_offset (t:base_typ) (n base:nat) (addr:int) (i:nat) = exists j.{:pattern (scale_t t j)} i <= j /\ j < n /\ base + scale_t t j == addr let rec get_addr_in_ptr (t:base_typ) (n base addr:nat) (i:nat) : Ghost nat (requires valid_offset t n base addr i) (ensures fun j -> base + scale_t t j == addr) (decreases %[n - i]) = if base + scale_t t i = addr then i else get_addr_in_ptr t n base addr (i + 1) let valid_buffer (t:base_typ) (addr:int) (b:b8) (h:vale_heap) : GTot bool = DV.length (get_downview b.bsrc) % (view_n t) = 0 && addr_in_ptr #t addr b h let writeable_buffer (t:base_typ) (addr:int) (b:b8) (h:vale_heap) : GTot bool = valid_buffer t addr b h && b.writeable
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
p1: Prims.list 'a -> p2: Prims.list 'a -> Prims.logical
Prims.Tot
[ "total" ]
[]
[ "Prims.list", "Prims.l_Forall", "Prims.l_imp", "FStar.List.Tot.Base.memP", "Prims.logical" ]
[]
false
false
false
true
true
let sub_list (p1 p2: list 'a) =
forall x. {:pattern List.memP x p2} List.memP x p1 ==> List.memP x p2
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.valid_mem64
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool
let valid_mem64 ptr h = valid_mem (TUInt64) ptr h
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 49, "end_line": 360, "start_col": 0, "start_line": 360 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2 let loc_includes_refl s = M.loc_includes_refl s let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3 let loc_includes_union_r s s1 s2 = M.loc_includes_union_r s s1 s2 let loc_includes_union_l s1 s2 s = M.loc_includes_union_l s1 s2 s let loc_includes_union_l_buffer #t s1 s2 b = M.loc_includes_union_l s1 s2 (loc_buffer b) let loc_includes_none s = M.loc_includes_none s let modifies_refl s h = M.modifies_refl s (_ih h).hs let modifies_goal_directed_refl s h = M.modifies_refl s (_ih h).hs let modifies_loc_includes s1 h h' s2 = M.modifies_loc_includes s1 (_ih h).hs (_ih h').hs s2 let modifies_trans s12 h1 h2 s23 h3 = M.modifies_trans s12 (_ih h1).hs (_ih h2).hs s23 (_ih h3).hs let modifies_goal_directed_trans s12 h1 h2 s13 h3 = modifies_trans s12 h1 h2 s13 h3; modifies_loc_includes s13 h1 h3 (loc_union s12 s13); () let modifies_goal_directed_trans2 s12 h1 h2 s13 h3 = modifies_goal_directed_trans s12 h1 h2 s13 h3 let default_of_typ (t:base_typ) : base_typ_as_vale_type t = allow_inversion base_typ; match t with | TUInt8 -> 0 | TUInt16 -> 0 | TUInt32 -> 0 | TUInt64 -> 0 | TUInt128 -> Vale.Def.Words_s.Mkfour #nat32 0 0 0 0 let buffer_read #t b i h = if i < 0 || i >= buffer_length b then default_of_typ t else Seq.index (buffer_as_seq h b) i let seq_upd (#b:_) (h:HS.mem) (vb:UV.buffer b{UV.live h vb}) (i:nat{i < UV.length vb}) (x:b) : Lemma (Seq.equal (Seq.upd (UV.as_seq h vb) i x) (UV.as_seq (UV.upd h vb i x) vb)) = let old_s = UV.as_seq h vb in let new_s = UV.as_seq (UV.upd h vb i x) vb in let upd_s = Seq.upd old_s i x in let rec aux (k:nat) : Lemma (requires (k <= Seq.length upd_s /\ (forall (j:nat). j < k ==> Seq.index upd_s j == Seq.index new_s j))) (ensures (forall (j:nat). j < Seq.length upd_s ==> Seq.index upd_s j == Seq.index new_s j)) (decreases %[(Seq.length upd_s) - k]) = if k = Seq.length upd_s then () else begin UV.sel_upd vb i k x h; UV.as_seq_sel h vb k; UV.as_seq_sel (UV.upd h vb i x) vb k; aux (k+1) end in aux 0 let buffer_write #t b i v h = if i < 0 || i >= buffer_length b then h else begin let view = uint_view t in let db = get_downview b.bsrc in let bv = UV.mk_buffer db view in UV.upd_modifies (_ih h).hs bv i (v_of_typ t v); UV.upd_equal_domains (_ih h).hs bv i (v_of_typ t v); let hs' = UV.upd (_ih h).hs bv i (v_of_typ t v) in let ih' = InteropHeap (_ih h).ptrs (_ih h).addrs hs' in let mh' = Vale.Interop.down_mem ih' in let h':vale_heap = ValeHeap mh' (Ghost.hide ih') h.heapletId in seq_upd (_ih h).hs bv i (v_of_typ t v); assert (Seq.equal (buffer_as_seq h' b) (Seq.upd (buffer_as_seq h b) i v)); h' end unfold let scale_t (t:base_typ) (index:int) : int = scale_by (view_n t) index // Checks if address addr corresponds to one of the elements of buffer ptr let addr_in_ptr (#t:base_typ) (addr:int) (ptr:buffer t) (h:vale_heap) : Ghost bool (requires True) (ensures fun b -> not b <==> (forall (i:int).{:pattern (scale_t t i)} 0 <= i /\ i < buffer_length ptr ==> addr <> (buffer_addr ptr h) + scale_t t i)) = let n = buffer_length ptr in let base = buffer_addr ptr h in let rec aux (i:nat) : Tot (b:bool{not b <==> (forall j. i <= j /\ j < n ==> addr <> base + scale_t t j)}) (decreases %[n-i]) = if i >= n then false else if addr = base + scale_t t i then true else aux (i+1) in aux 0 let valid_offset (t:base_typ) (n base:nat) (addr:int) (i:nat) = exists j.{:pattern (scale_t t j)} i <= j /\ j < n /\ base + scale_t t j == addr let rec get_addr_in_ptr (t:base_typ) (n base addr:nat) (i:nat) : Ghost nat (requires valid_offset t n base addr i) (ensures fun j -> base + scale_t t j == addr) (decreases %[n - i]) = if base + scale_t t i = addr then i else get_addr_in_ptr t n base addr (i + 1) let valid_buffer (t:base_typ) (addr:int) (b:b8) (h:vale_heap) : GTot bool = DV.length (get_downview b.bsrc) % (view_n t) = 0 && addr_in_ptr #t addr b h let writeable_buffer (t:base_typ) (addr:int) (b:b8) (h:vale_heap) : GTot bool = valid_buffer t addr b h && b.writeable #set-options "--max_fuel 1 --max_ifuel 1" let sub_list (p1 p2:list 'a) = forall x. {:pattern List.memP x p2} List.memP x p1 ==> List.memP x p2 let rec valid_mem_aux (t:base_typ) addr (ps:list b8) (h:vale_heap) : Ghost bool (requires sub_list ps (_ih h).ptrs) (ensures fun b -> b <==> (exists (x:buffer t). {:pattern (List.memP x ps) \/ (valid_buffer t addr x h)} List.memP x ps /\ valid_buffer t addr x h)) = match ps with | [] -> false | a::q -> valid_buffer t addr a h || valid_mem_aux t addr q h
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
ptr: Prims.int -> h: Vale.Arch.HeapImpl.vale_heap -> Prims.GTot Prims.bool
Prims.GTot
[ "sometrivial" ]
[]
[ "Prims.int", "Vale.Arch.HeapImpl.vale_heap", "Vale.PPC64LE.Memory.valid_mem", "Vale.Arch.HeapTypes_s.TUInt64", "Prims.bool" ]
[]
false
false
false
false
false
let valid_mem64 ptr h =
valid_mem (TUInt64) ptr h
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_includes_trans
val loc_includes_trans (s1 s2 s3:loc) : Lemma (requires (loc_includes s1 s2 /\ loc_includes s2 s3)) (ensures (loc_includes s1 s3))
val loc_includes_trans (s1 s2 s3:loc) : Lemma (requires (loc_includes s1 s2 /\ loc_includes s2 s3)) (ensures (loc_includes s1 s3))
let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 63, "end_line": 236, "start_col": 0, "start_line": 236 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s1: Vale.PPC64LE.Memory.loc -> s2: Vale.PPC64LE.Memory.loc -> s3: Vale.PPC64LE.Memory.loc -> FStar.Pervasives.Lemma (requires Vale.PPC64LE.Memory.loc_includes s1 s2 /\ Vale.PPC64LE.Memory.loc_includes s2 s3) (ensures Vale.PPC64LE.Memory.loc_includes s1 s3)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.PPC64LE.Memory.loc", "LowStar.Monotonic.Buffer.loc_includes_trans", "Prims.unit" ]
[]
true
false
true
false
false
let loc_includes_trans s1 s2 s3 =
M.loc_includes_trans s1 s2 s3
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.loc_includes_union_l
val loc_includes_union_l (s1 s2 s:loc) : Lemma (requires (loc_includes s1 s \/ loc_includes s2 s)) (ensures (loc_includes (loc_union s1 s2) s))
val loc_includes_union_l (s1 s2 s:loc) : Lemma (requires (loc_includes s1 s \/ loc_includes s2 s)) (ensures (loc_includes (loc_union s1 s2) s))
let loc_includes_union_l s1 s2 s = M.loc_includes_union_l s1 s2 s
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 65, "end_line": 238, "start_col": 0, "start_line": 238 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal () let index128_get_heap_val128 (h:vale_heap) (b:buffer128{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (ensures ( let addr = buffer_addr b h in Seq.index (buffer_as_seq h b) i == Mkfour (S.get_heap_val32 (addr + scale16 i) heap) (S.get_heap_val32 (addr + scale16 i+4) heap) (S.get_heap_val32 (addr + scale16 i+8) heap) (S.get_heap_val32 (addr + scale16 i +12) heap) )) = let db = get_downview b.bsrc in let vb = UV.mk_buffer db uint128_view in let ptr = buffer_addr b h + scale16 i in let s = DV.as_seq (_ih h).hs db in let addr = buffer_addr b h in UV.length_eq vb; UV.as_seq_sel (_ih h).hs vb i; UV.get_sel (_ih h).hs vb i; let sl = Seq.slice s (i*16) (i*16+16) in let aux (j:nat{j < 16}) : Lemma (UInt8.v (Seq.index sl j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*16 + j)) == heap.[addr + (i*16+j)]); Seq.lemma_index_slice s (i*16) (i*16+16) j; assert (UInt8.v (Seq.index sl j) == heap.[addr+(i*16+j)]); index_mul_helper addr i 16 j in Classical.forall_intro aux; index128_get_heap_val128_aux sl ptr heap let modifies_goal_directed s h1 h2 = modifies s h1 h2 let lemma_modifies_goal_directed s h1 h2 = () let buffer_length_buffer_as_seq #t h b = () let same_underlying_seq (#t:base_typ) (h1 h2:vale_heap) (b:buffer t) : Lemma (requires Seq.equal (DV.as_seq (_ih h1).hs (get_downview b.bsrc)) (DV.as_seq (_ih h2).hs (get_downview b.bsrc))) (ensures Seq.equal (buffer_as_seq h1 b) (buffer_as_seq h2 b)) = let db = get_downview b.bsrc in let rec aux (i:nat{i <= buffer_length b}) : Lemma (requires (forall (j:nat{j < i}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j) /\ (Seq.equal (DV.as_seq (_ih h1).hs db) (DV.as_seq (_ih h2).hs db))) (ensures (forall (j:nat{j < buffer_length b}). Seq.index (buffer_as_seq h1 b) j == Seq.index (buffer_as_seq h2 b) j)) (decreases %[(buffer_length b) - i]) = if i = buffer_length b then () else ( let bv = UV.mk_buffer db (uint_view t) in UV.get_sel (_ih h1).hs bv i; UV.get_sel (_ih h2).hs bv i; UV.as_seq_sel (_ih h1).hs bv i; UV.as_seq_sel (_ih h2).hs bv i; aux (i+1) ) in aux 0 let modifies_buffer_elim #t1 b p h h' = let db = get_downview b.bsrc in lemma_dv_equal (down_view b.src) b.bsrc (_ih h).hs (_ih h').hs; same_underlying_seq h h' b; assert (Seq.equal (buffer_as_seq h b) (buffer_as_seq h' b)) let modifies_buffer_addr #t b p h h' = () let modifies_buffer_readable #t b p h h' = () let loc_disjoint_none_r s = M.loc_disjoint_none_r s let loc_disjoint_union_r s s1 s2 = M.loc_disjoint_union_r s s1 s2 let loc_includes_refl s = M.loc_includes_refl s let loc_includes_trans s1 s2 s3 = M.loc_includes_trans s1 s2 s3
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s1: Vale.PPC64LE.Memory.loc -> s2: Vale.PPC64LE.Memory.loc -> s: Vale.PPC64LE.Memory.loc -> FStar.Pervasives.Lemma (requires Vale.PPC64LE.Memory.loc_includes s1 s \/ Vale.PPC64LE.Memory.loc_includes s2 s) (ensures Vale.PPC64LE.Memory.loc_includes (Vale.PPC64LE.Memory.loc_union s1 s2) s)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.PPC64LE.Memory.loc", "LowStar.Monotonic.Buffer.loc_includes_union_l", "Prims.unit" ]
[]
true
false
true
false
false
let loc_includes_union_l s1 s2 s =
M.loc_includes_union_l s1 s2 s
false
Vale.PPC64LE.Memory.fst
Vale.PPC64LE.Memory.index128_get_heap_val128_aux
val index128_get_heap_val128_aux (s: Seq.lseq UInt8.t 16) (ptr: int) (heap: S.machine_heap) : Lemma (requires (forall (j: nat). j < 16 ==> UInt8.v (Seq.index s j) == heap.[ ptr + j ])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr + 4) heap) (S.get_heap_val32 (ptr + 8) heap) (S.get_heap_val32 (ptr + 12) heap))
val index128_get_heap_val128_aux (s: Seq.lseq UInt8.t 16) (ptr: int) (heap: S.machine_heap) : Lemma (requires (forall (j: nat). j < 16 ==> UInt8.v (Seq.index s j) == heap.[ ptr + j ])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr + 4) heap) (S.get_heap_val32 (ptr + 8) heap) (S.get_heap_val32 (ptr + 12) heap))
let index128_get_heap_val128_aux (s:Seq.lseq UInt8.t 16) (ptr:int) (heap:S.machine_heap) : Lemma (requires (forall (j:nat) . j < 16 ==> UInt8.v (Seq.index s j) == heap.[ptr+j])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr+4) heap) (S.get_heap_val32 (ptr+8) heap) (S.get_heap_val32 (ptr+12) heap)) = reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal ()
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 47, "end_line": 163, "start_col": 0, "start_line": 153 }
module Vale.PPC64LE.Memory include Vale.Interop.Types friend Vale.Arch.Heap open Vale.Def.Opaque_s open Vale.Arch.HeapImpl open Vale.Arch.Heap open Vale.Interop.Base module IB = Vale.Interop.Base module I = Vale.Interop module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MB = LowStar.Monotonic.Buffer module M = LowStar.Modifies open LowStar.ModifiesPat module UV = LowStar.BufferView.Up module DV = LowStar.BufferView.Down open Vale.Lib.BufferViewHelpers module H = FStar.Heap module S = Vale.Arch.MachineHeap_s #reset-options "--initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" let b8 = IB.b8 unfold let (.[]) = Map.sel unfold let (.[]<-) = Map.upd let get_heaplet_id h = h.heapletId let tuint8 = UInt8.t let tuint16 = UInt16.t let tuint32 = UInt32.t let tuint64 = UInt64.t let v_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : base_typ_as_type t = match t with | TUInt8 -> UInt8.uint_to_t v | TUInt16 -> UInt16.uint_to_t v | TUInt32 -> UInt32.uint_to_t v | TUInt64 -> UInt64.uint_to_t v | TUInt128 -> v let v_to_typ (t:base_typ) (v:base_typ_as_type t) : base_typ_as_vale_type t = match t with | TUInt8 -> UInt8.v v | TUInt16 -> UInt16.v v | TUInt32 -> UInt32.v v | TUInt64 -> UInt64.v v | TUInt128 -> v let lemma_v_to_of_typ (t:base_typ) (v:base_typ_as_vale_type t) : Lemma (ensures v_to_typ t (v_of_typ t v) == v) [SMTPat (v_to_typ t (v_of_typ t v))] = () let uint8_view = Vale.Interop.Views.up_view8 let uint16_view = Vale.Interop.Views.up_view16 let uint32_view = Vale.Interop.Views.up_view32 let uint64_view = Vale.Interop.Views.up_view64 let uint128_view = Vale.Interop.Views.up_view128 let uint_view (t:base_typ) : (v:UV.view UInt8.t (IB.base_typ_as_type t){UV.View?.n v == view_n t}) = match t with | TUInt8 -> uint8_view | TUInt16 -> uint16_view | TUInt32 -> uint32_view | TUInt64 -> uint64_view | TUInt128 -> uint128_view let buffer_as_seq #t h b = let s = UV.as_seq (IB.hs_of_mem (_ih h)) (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) in Vale.Lib.Seqs_s.seq_map (v_to_typ t) s let buffer_readable #t h b = List.memP b (IB.ptrs_of_mem (_ih h)) let buffer_writeable #t b = b.writeable let buffer_length #t b = UV.length (UV.mk_buffer (get_downview b.bsrc) (uint_view t)) let loc = M.loc let loc_none = M.loc_none let loc_union = M.loc_union let loc_buffer #t b = M.loc_buffer b.bsrc let loc_disjoint = M.loc_disjoint let loc_includes = M.loc_includes let modifies s h h' = M.modifies s (_ih h).hs (_ih h').hs /\ h.heapletId == h'.heapletId /\ (_ih h).ptrs == (_ih h').ptrs /\ (_ih h).addrs == (_ih h').addrs /\ HST.equal_domains (_ih h).hs (_ih h').hs let buffer_addr #t b h = IB.addrs_of_mem (_ih h) b open FStar.Mul #set-options "--z3rlimit 20" let index64_heap_aux (s:Seq.lseq UInt8.t 8) (heap:S.machine_heap) (ptr:int) : Lemma (requires forall (j:nat{j < 8}). UInt8.v (Seq.index s j) == heap.[ptr+j]) (ensures UInt64.v (Vale.Interop.Views.get64 s) == S.get_heap_val64 ptr heap) = let open Vale.Def.Words.Seq_s in reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); Vale.Interop.Views.get64_reveal (); S.get_heap_val64_reveal (); Vale.Def.Types_s.le_bytes_to_nat64_reveal () let index_helper (x y:int) (heap:S.machine_heap) : Lemma (requires x == y) (ensures heap.[x] == heap.[y]) = () let index_mul_helper (addr i n j:int) : Lemma (addr + (i * n + j) == addr + n * i + j) = () #set-options "--max_fuel 0 --max_ifuel 0" let index64_get_heap_val64 (h:vale_heap) (b:buffer64{List.memP b (_ih h).ptrs}) (heap:S.machine_heap{IB.correct_down (_ih h) heap}) (i:nat{i < buffer_length b}) : Lemma (Seq.index (buffer_as_seq h b) i == S.get_heap_val64 (buffer_addr b h + scale8 i) heap) = let db = get_downview b.bsrc in let ub = UV.mk_buffer db uint64_view in let ptr = buffer_addr b h + scale8 i in let s = DV.as_seq (_ih h).hs db in let t = TUInt64 in let addr = buffer_addr b h in UV.length_eq ub; UV.as_seq_sel (_ih h).hs ub i; UV.get_sel (_ih h).hs ub i; let s' = Seq.slice s (i*8) (i*8 + 8) in let aux (j:nat{j < 8}) : Lemma (UInt8.v (Seq.index s' j) == heap.[ptr+j]) = assert (UInt8.v (Seq.index s (i*8 + j)) == heap.[addr + (i*8+j)]); Seq.lemma_index_slice s (i*8) (i*8+8) j; assert (UInt8.v (Seq.index s' j) == heap.[addr+(i*8+j)]); index_mul_helper addr i 8 j; () in Classical.forall_intro aux; index64_heap_aux s' heap ptr #set-options "--z3rlimit 50" open Vale.Def.Words_s open Vale.Def.Types_s open Vale.Def.Words.Seq_s open Vale.Def.Words.Four_s open Vale.Lib.Seqs_s
{ "checked_file": "/", "dependencies": [ "Vale.X64.Machine_s.fst.checked", "Vale.Lib.Seqs_s.fst.checked", "Vale.Lib.BufferViewHelpers.fst.checked", "Vale.Interop.Views.fsti.checked", "Vale.Interop.Types.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Words.Four_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.MachineHeap_s.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fst.checked", "prims.fst.checked", "LowStar.Monotonic.Buffer.fsti.checked", "LowStar.ModifiesPat.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.Set.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Map.fsti.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Heap.fst.checked", "FStar.Ghost.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Memory.fst" }
[ { "abbrev": false, "full_module": "Vale.Lib.Seqs_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Four_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.Arch.MachineHeap_s", "short_module": "S" }, { "abbrev": true, "full_module": "FStar.Heap", "short_module": "H" }, { "abbrev": false, "full_module": "Vale.Lib.BufferViewHelpers", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": false, "full_module": "LowStar.ModifiesPat", "short_module": null }, { "abbrev": true, "full_module": "LowStar.Modifies", "short_module": "M" }, { "abbrev": true, "full_module": "LowStar.Monotonic.Buffer", "short_module": "MB" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "Vale.Interop.Base", "short_module": "IB" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Types", "short_module": null }, { "abbrev": true, "full_module": "Vale.Lib.Map16", "short_module": "Map16" }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapTypes_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: FStar.Seq.Properties.lseq FStar.UInt8.t 16 -> ptr: Prims.int -> heap: Vale.Arch.MachineHeap_s.machine_heap -> FStar.Pervasives.Lemma (requires forall (j: Prims.nat). j < 16 ==> FStar.UInt8.v (FStar.Seq.Base.index s j) == heap.[ ptr + j ]) (ensures Vale.Interop.Views.get128 s == Vale.Def.Words_s.Mkfour (Vale.Arch.MachineHeap_s.get_heap_val32 ptr heap) (Vale.Arch.MachineHeap_s.get_heap_val32 (ptr + 4) heap) (Vale.Arch.MachineHeap_s.get_heap_val32 (ptr + 8) heap) (Vale.Arch.MachineHeap_s.get_heap_val32 (ptr + 12) heap))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "FStar.Seq.Properties.lseq", "FStar.UInt8.t", "Prims.int", "Vale.Arch.MachineHeap_s.machine_heap", "Vale.Def.Types_s.le_bytes_to_quad32_reveal", "Prims.unit", "Vale.Interop.Views.get128_reveal", "Vale.Arch.MachineHeap_s.get_heap_val32_reveal", "FStar.Pervasives.reveal_opaque", "FStar.Seq.Base.seq", "Vale.Def.Types_s.nat8", "Prims.eq2", "Prims.op_Modulus", "FStar.Seq.Base.length", "Vale.Def.Words_s.four", "Prims.op_Division", "Vale.Def.Words.Seq_s.seq_to_seq_four_LE", "Prims.l_Forall", "Prims.nat", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.l_or", "FStar.UInt.size", "FStar.UInt8.n", "Prims.l_and", "Prims.op_GreaterThanOrEqual", "Vale.Def.Words_s.pow2_8", "FStar.UInt8.v", "FStar.Seq.Base.index", "Vale.PPC64LE.Memory.op_String_Access", "Prims.op_Addition", "Prims.squash", "Vale.Def.Types_s.nat32", "Vale.Interop.Views.get128", "Vale.Def.Words_s.Mkfour", "Vale.Arch.MachineHeap_s.get_heap_val32", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let index128_get_heap_val128_aux (s: Seq.lseq UInt8.t 16) (ptr: int) (heap: S.machine_heap) : Lemma (requires (forall (j: nat). j < 16 ==> UInt8.v (Seq.index s j) == heap.[ ptr + j ])) (ensures Vale.Interop.Views.get128 s == Mkfour (S.get_heap_val32 ptr heap) (S.get_heap_val32 (ptr + 4) heap) (S.get_heap_val32 (ptr + 8) heap) (S.get_heap_val32 (ptr + 12) heap)) =
reveal_opaque (`%seq_to_seq_four_LE) (seq_to_seq_four_LE #nat8); S.get_heap_val32_reveal (); Vale.Interop.Views.get128_reveal (); Vale.Def.Types_s.le_bytes_to_quad32_reveal ()
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.load_felem1_le
val load_felem1_le: f:felem 1 -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem1 (as_seq h0 b))
val load_felem1_le: f:felem 1 -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b = let h0 = ST.get () in let lo = vec_load_le U64 1 (sub b 0ul 8ul) in let hi = vec_load_le U64 1 (sub b 8ul 8ul) in load_felem f lo hi; let h1 = ST.get () in uints_from_bytes_le_lemma64_1 (as_seq h0 b); LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 59, "end_line": 593, "start_col": 0, "start_line": 585 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #push-options "--max_fuel 1" inline_for_extraction noextract val fmul_r: #w:lanes -> out:felem w -> f1:felem w -> r:felem w -> r5:felem w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h r /\ live h r5 /\ felem_fits h f1 (3,3,3,3,3) /\ felem_fits h r (2,2,2,2,2) /\ felem_fits h r5 (10,10,10,10,10) /\ as_tup5 h r5 == precomp_r5 (as_tup5 h r)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) let fmul_r #w out f1 r r5 = let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let (o0, o1, o2, o3, o4) = fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #pop-options inline_for_extraction noextract val fadd_mul_r: #w:lanes -> acc:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h acc /\ live h f1 /\ live h p /\ felem_fits h acc (2,2,2,2,2) /\ felem_fits h f1 (1,1,1,1,1) /\ fmul_precomp_r_pre h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (1,2,1,1,2) /\ feval h1 acc == LSeq.map2 (Vec.pfmul) (LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) let fadd_mul_r #w out f1 p = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let a0 = out.(0ul) in let a1 = out.(1ul) in let a2 = out.(2ul) in let a3 = out.(3ul) in let a4 = out.(4ul) in let (o0, o1, o2, o3, o4) = fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 inline_for_extraction noextract val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) let fmul_rn #w out f1 p = let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5 inline_for_extraction noextract val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (fas_nat h1 f).[0] == (feval h0 f).[0]) let reduce_felem #w f = let f0 = f.(0ul) in let f1 = f.(1ul) in let f2 = f.(2ul) in let f3 = f.(3ul) in let f4 = f.(4ul) in let (f0, f1, f2, f3, f4) = reduce_felem5 (f0, f1, f2, f3, f4) in f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 inline_for_extraction noextract val precompute_shift_reduce: #w:lanes -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2)) let precompute_shift_reduce #w f1 f2 = let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in f1.(0ul) <- vec_smul_mod f20 (u64 5); f1.(1ul) <- vec_smul_mod f21 (u64 5); f1.(2ul) <- vec_smul_mod f22 (u64 5); f1.(3ul) <- vec_smul_mod f23 (u64 5); f1.(4ul) <- vec_smul_mod f24 (u64 5) inline_for_extraction noextract val load_felem: #w:lanes -> f:felem w -> lo:uint64xN w -> hi:uint64xN w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == LSeq.createi #Vec.pfelem w (fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i])) let load_felem #w f lo hi = let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in load_felem5_lemma #w lo hi; f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 #push-options "--max_fuel 2" inline_for_extraction noextract val load_precompute_r1: p:precomp_r 1 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r1 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 1 in let r_vec1 = vec_load r1 1 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; copy_felem #_ #(1,1,1,1,1) rn r; copy_felem #_ #(5,5,5,5,5) rn_5 r5 inline_for_extraction noextract val load_precompute_r2: p:precomp_r 2 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r2 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 2 in let r_vec1 = vec_load r1 2 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; let h2 = ST.get () in fmul_r rn r r r5; let h3 = ST.get () in LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]); precompute_shift_reduce rn_5 rn inline_for_extraction noextract val load_precompute_r4: p:precomp_r 4 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r4 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 4 in let r_vec1 = vec_load r1 4 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; fmul_r rn r r r5; precompute_shift_reduce rn_5 rn; fmul_r rn rn rn rn_5; let h3 = ST.get () in LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]); precompute_shift_reduce rn_5 rn inline_for_extraction noextract val load_precompute_r: #w:lanes -> p:precomp_r w -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post #w h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create w (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r #w p r0 r1 = match w with | 1 -> load_precompute_r1 p r0 r1 | 2 -> load_precompute_r2 p r0 r1 | 4 -> load_precompute_r4 p r0 r1 #pop-options inline_for_extraction noextract val load_felem1_le: f:felem 1 -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Impl.Poly1305.Field32xN.felem 1 -> b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Poly1305.Field32xN.felem", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "FStar.UInt32.__uint_to_t", "Lib.Sequence.eq_intro", "Hacl.Spec.Poly1305.Vec.pfelem", "Hacl.Impl.Poly1305.Field32xN.feval", "Hacl.Spec.Poly1305.Vec.load_elem1", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Prims.unit", "Hacl.Impl.Poly1305.Lemmas.uints_from_bytes_le_lemma64_1", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Hacl.Impl.Poly1305.Field32xN.load_felem", "Lib.IntVector.vec_t", "Lib.IntTypes.U64", "Lib.IntVector.vec_load_le", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.int_t", "Lib.IntTypes.U8", "Lib.IntTypes.SEC", "Lib.IntTypes.mul", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Lib.IntTypes.mk_int", "Lib.Buffer.sub" ]
[]
false
true
false
false
false
let load_felem1_le f b =
let h0 = ST.get () in let lo = vec_load_le U64 1 (sub b 0ul 8ul) in let hi = vec_load_le U64 1 (sub b 8ul 8ul) in load_felem f lo hi; let h1 = ST.get () in uints_from_bytes_le_lemma64_1 (as_seq h0 b); LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
false
Hacl.Impl.Poly1305.Field32xN.fst
Hacl.Impl.Poly1305.Field32xN.load_blocks
val load_blocks: #w:lanes -> f:felem w -> b:lbuffer uint8 (size w *! 16ul) -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == Vec.load_blocks #w (as_seq h0 b))
val load_blocks: #w:lanes -> f:felem w -> b:lbuffer uint8 (size w *! 16ul) -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == Vec.load_blocks #w (as_seq h0 b))
let load_blocks #s f b = load_felems_le f b; set_bit128 f
{ "file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 14, "end_line": 675, "start_col": 0, "start_line": 673 }
module Hacl.Impl.Poly1305.Field32xN open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Lib.IntVector include Hacl.Spec.Poly1305.Field32xN open Hacl.Spec.Poly1305.Field32xN.Lemmas open Hacl.Impl.Poly1305.Lemmas module Vec = Hacl.Spec.Poly1305.Vec module ST = FStar.HyperStack.ST module LSeq = Lib.Sequence module BSeq = Lib.ByteSequence #set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" inline_for_extraction noextract let felem (w:lanes) = lbuffer (uint64xN w) 5ul inline_for_extraction noextract let felem_wide (w:lanes) = felem w inline_for_extraction noextract let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul unfold noextract let op_String_Access #a #len = LSeq.index #a #len noextract val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) let as_tup5 #w h f = let s = as_seq h f in let s0 = s.[0] in let s1 = s.[1] in let s2 = s.[2] in let s3 = s.[3] in let s4 = s.[4] in (s0,s1,s2,s3,s4) noextract val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_fits #w h f m = felem_fits5 (as_tup5 h f) m noextract val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 let felem_wide_fits #w h f m = felem_wide_fits5 (as_tup5 h f) m noextract let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) = feval5 (as_tup5 h f) noextract let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) = fas_nat5 (as_tup5 h f) noextract let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 = felem_less5 (as_tup5 h f) max val lemma_feval_is_fas_nat: #w:lanes -> h:mem -> f:felem w -> Lemma (requires felem_less h f (pow2 128)) (ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) let lemma_feval_is_fas_nat #w h f = lemma_feval_is_fas_nat (as_tup5 h f) inline_for_extraction noextract val fmul_precomp_r_pre: #w:lanes -> h:mem -> precomp:precomp_r w -> Type0 let fmul_precomp_r_pre #w h precomp = let r = gsub precomp 0ul 5ul in let r_5 = gsub precomp 5ul 5ul in felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\ as_tup5 h r_5 == precomp_r5 (as_tup5 h r) noextract val load_precompute_r_post: #w:lanes -> h:mem -> p:precomp_r w -> Type0 let load_precompute_r_post #w h p = assert_norm (pow2 128 < Vec.prime); let r = gsub p 0ul 5ul in let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[0] inline_for_extraction noextract val create_felem: w:lanes -> StackInline (felem w) (requires fun h -> True) (ensures fun h0 b h1 -> stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ feval h1 b == LSeq.create w 0) let create_felem w = let r = create 5ul (zero w) in let h1 = ST.get () in LSeq.eq_intro (feval h1 r) (LSeq.create w 0); r #push-options "--z3rlimit 100" inline_for_extraction noextract val set_bit: #w:lanes -> f:felem w -> i:size_t{size_v i <= 128} -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 (v i))) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (Math.Lemmas.pow2_le_compat 128 (v i); feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) let set_bit #w f i = let b = u64 1 <<. (i %. 26ul) in let mask = vec_load b w in let fi = f.(i /. 26ul) in let h0 = ST.get () in f.(i /. 26ul) <- vec_or fi mask; set_bit5_lemma (as_seq h0 f) (v i) #pop-options inline_for_extraction noextract val set_bit128: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (1, 1, 1, 1, 1) /\ felem_less #w h f (pow2 128)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) let set_bit128 #w f = let b = u64 0x1000000 in assert_norm (0x1000000 = pow2 24); assert (v b == v (u64 1 <<. 24ul)); let mask = vec_load b w in let f4 = f.(4ul) in let h0 = ST.get () in f.(4ul) <- vec_or f4 mask; set_bit5_lemma (as_seq h0 f) 128 inline_for_extraction noextract val set_zero: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (0, 0, 0, 0, 0) /\ feval h1 f == LSeq.create w 0) let set_zero #w f = f.(0ul) <- zero w; f.(1ul) <- zero w; f.(2ul) <- zero w; f.(3ul) <- zero w; f.(4ul) <- zero w; let h1 = ST.get () in LSeq.eq_intro (feval h1 f) (LSeq.create w 0) inline_for_extraction noextract val copy_felem: #w:lanes -> #m:scale32_5 -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ disjoint f1 f2 /\ felem_fits h f2 m) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ felem_fits h1 f1 m /\ as_tup5 h1 f1 == as_tup5 h0 f2) let copy_felem #w #m f1 f2 = f1.(0ul) <- f2.(0ul); f1.(1ul) <- f2.(1ul); f1.(2ul) <- f2.(2ul); f1.(3ul) <- f2.(3ul); f1.(4ul) <- f2.(4ul) inline_for_extraction noextract val fadd: #w:lanes -> out:felem w -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2 /\ live h out /\ felem_fits h f1 (2,2,2,2,2) /\ felem_fits h f2 (1,1,1,1,1)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ //as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\ felem_fits h1 out (3,3,3,3,3) /\ feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) let fadd #w out f1 f2 = let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in let (o0,o1,o2,o3,o4) = fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #push-options "--max_fuel 1" inline_for_extraction noextract val fmul_r: #w:lanes -> out:felem w -> f1:felem w -> r:felem w -> r5:felem w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h r /\ live h r5 /\ felem_fits h f1 (3,3,3,3,3) /\ felem_fits h r (2,2,2,2,2) /\ felem_fits h r5 (10,10,10,10,10) /\ as_tup5 h r5 == precomp_r5 (as_tup5 h r)) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) let fmul_r #w out f1 r r5 = let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let (o0, o1, o2, o3, o4) = fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 #pop-options inline_for_extraction noextract val fadd_mul_r: #w:lanes -> acc:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h acc /\ live h f1 /\ live h p /\ felem_fits h acc (2,2,2,2,2) /\ felem_fits h f1 (1,1,1,1,1) /\ fmul_precomp_r_pre h p) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ felem_fits h1 acc (1,2,1,1,2) /\ feval h1 acc == LSeq.map2 (Vec.pfmul) (LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) let fadd_mul_r #w out f1 p = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let r0 = r.(0ul) in let r1 = r.(1ul) in let r2 = r.(2ul) in let r3 = r.(3ul) in let r4 = r.(4ul) in let r50 = r5.(0ul) in let r51 = r5.(1ul) in let r52 = r5.(2ul) in let r53 = r5.(3ul) in let r54 = r5.(4ul) in let f10 = f1.(0ul) in let f11 = f1.(1ul) in let f12 = f1.(2ul) in let f13 = f1.(3ul) in let f14 = f1.(4ul) in let a0 = out.(0ul) in let a1 = out.(1ul) in let a2 = out.(2ul) in let a3 = out.(3ul) in let a4 = out.(4ul) in let (o0, o1, o2, o3, o4) = fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in out.(0ul) <- o0; out.(1ul) <- o1; out.(2ul) <- o2; out.(3ul) <- o3; out.(4ul) <- o4 inline_for_extraction noextract val fmul_rn: #w:lanes -> out:felem w -> f1:felem w -> p:precomp_r w -> Stack unit (requires fun h -> live h out /\ live h f1 /\ live h p /\ (let rn = gsub p 10ul 5ul in let rn_5 = gsub p 15ul 5ul in felem_fits h f1 (3,3,3,3,3) /\ felem_fits h rn (2,2,2,2,2) /\ felem_fits h rn_5 (10,10,10,10,10) /\ as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn))) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ felem_fits h1 out (1,2,1,1,2) /\ feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) let fmul_rn #w out f1 p = let rn = sub p 10ul 5ul in let rn5 = sub p 15ul 5ul in fmul_r #w out f1 rn rn5 inline_for_extraction noextract val reduce_felem: #w:lanes -> f:felem w -> Stack unit (requires fun h -> live h f /\ felem_fits h f (2,2,2,2,2)) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ (fas_nat h1 f).[0] == (feval h0 f).[0]) let reduce_felem #w f = let f0 = f.(0ul) in let f1 = f.(1ul) in let f2 = f.(2ul) in let f3 = f.(3ul) in let f4 = f.(4ul) in let (f0, f1, f2, f3, f4) = reduce_felem5 (f0, f1, f2, f3, f4) in f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 inline_for_extraction noextract val precompute_shift_reduce: #w:lanes -> f1:felem w -> f2:felem w -> Stack unit (requires fun h -> live h f1 /\ live h f2) (ensures fun h0 _ h1 -> modifies (loc f1) h0 h1 /\ as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2)) let precompute_shift_reduce #w f1 f2 = let f20 = f2.(0ul) in let f21 = f2.(1ul) in let f22 = f2.(2ul) in let f23 = f2.(3ul) in let f24 = f2.(4ul) in f1.(0ul) <- vec_smul_mod f20 (u64 5); f1.(1ul) <- vec_smul_mod f21 (u64 5); f1.(2ul) <- vec_smul_mod f22 (u64 5); f1.(3ul) <- vec_smul_mod f23 (u64 5); f1.(4ul) <- vec_smul_mod f24 (u64 5) inline_for_extraction noextract val load_felem: #w:lanes -> f:felem w -> lo:uint64xN w -> hi:uint64xN w -> Stack unit (requires fun h -> live h f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == LSeq.createi #Vec.pfelem w (fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i])) let load_felem #w f lo hi = let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in load_felem5_lemma #w lo hi; f.(0ul) <- f0; f.(1ul) <- f1; f.(2ul) <- f2; f.(3ul) <- f3; f.(4ul) <- f4 #push-options "--max_fuel 2" inline_for_extraction noextract val load_precompute_r1: p:precomp_r 1 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r1 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 1 in let r_vec1 = vec_load r1 1 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; copy_felem #_ #(1,1,1,1,1) rn r; copy_felem #_ #(5,5,5,5,5) rn_5 r5 inline_for_extraction noextract val load_precompute_r2: p:precomp_r 2 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r2 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 2 in let r_vec1 = vec_load r1 2 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; let h2 = ST.get () in fmul_r rn r r r5; let h3 = ST.get () in LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]); precompute_shift_reduce rn_5 rn inline_for_extraction noextract val load_precompute_r4: p:precomp_r 4 -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r4 p r0 r1 = let r = sub p 0ul 5ul in let r5 = sub p 5ul 5ul in let rn = sub p 10ul 5ul in let rn_5 = sub p 15ul 5ul in let r_vec0 = vec_load r0 4 in let r_vec1 = vec_load r1 4 in let h0 = ST.get () in load_felem r r_vec0 r_vec1; let h1 = ST.get () in LSeq.eq_intro (LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i])) (LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)); assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)); precompute_shift_reduce r5 r; fmul_r rn r r r5; precompute_shift_reduce rn_5 rn; fmul_r rn rn rn rn_5; let h3 = ST.get () in LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]); precompute_shift_reduce rn_5 rn inline_for_extraction noextract val load_precompute_r: #w:lanes -> p:precomp_r w -> r0:uint64 -> r1:uint64 -> Stack unit (requires fun h -> live h p) (ensures fun h0 _ h1 -> modifies (loc p) h0 h1 /\ load_precompute_r_post #w h1 p /\ (assert_norm (pow2 64 * pow2 64 = pow2 128); feval h1 (gsub p 0ul 5ul) == LSeq.create w (uint_v r1 * pow2 64 + uint_v r0))) let load_precompute_r #w p r0 r1 = match w with | 1 -> load_precompute_r1 p r0 r1 | 2 -> load_precompute_r2 p r0 r1 | 4 -> load_precompute_r4 p r0 r1 #pop-options inline_for_extraction noextract val load_felem1_le: f:felem 1 -> b:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem1 (as_seq h0 b)) let load_felem1_le f b = let h0 = ST.get () in let lo = vec_load_le U64 1 (sub b 0ul 8ul) in let hi = vec_load_le U64 1 (sub b 8ul 8ul) in load_felem f lo hi; let h1 = ST.get () in uints_from_bytes_le_lemma64_1 (as_seq h0 b); LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b)) inline_for_extraction noextract val load_felem2_le: f:felem 2 -> b:lbuffer uint8 32ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem2 (as_seq h0 b)) let load_felem2_le f b = let h0 = ST.get () in let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in let lo = vec_interleave_low b1 b2 in let hi = vec_interleave_high b1 b2 in load_felem f lo hi; let h1 = ST.get () in vec_interleave_low_lemma2 b1 b2; vec_interleave_high_lemma2 b1 b2; uints_from_bytes_le_lemma64_2 (as_seq h0 b); LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b)) inline_for_extraction noextract val load_felem4_le: f:felem 4 -> b:lbuffer uint8 64ul -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem4 (as_seq h0 b)) let load_felem4_le f b = let h0 = ST.get () in let lo = vec_load_le U64 4 (sub b 0ul 32ul) in let hi = vec_load_le U64 4 (sub b 32ul 32ul) in let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in load_felem5_le (as_seq h0 b); f.(0ul) <- o0; f.(1ul) <- o1; f.(2ul) <- o2; f.(3ul) <- o3; f.(4ul) <- o4 inline_for_extraction noextract val load_felems_le: #w:lanes -> f:felem w -> b:lbuffer uint8 (size w *! 16ul) -> Stack unit (requires fun h -> live h f /\ live h b) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\ felem_less h1 f (pow2 128) /\ feval h1 f == Vec.load_elem (as_seq h0 b)) let load_felems_le #w f b = match w with | 1 -> load_felem1_le f b | 2 -> load_felem2_le f b | 4 -> load_felem4_le f b inline_for_extraction noextract val load_blocks: #w:lanes -> f:felem w -> b:lbuffer uint8 (size w *! 16ul) -> Stack unit (requires fun h -> live h b /\ live h f /\ disjoint b f) (ensures fun h0 _ h1 -> modifies (loc f) h0 h1 /\ felem_fits h1 f (1, 1, 1, 1, 1) /\
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntVector.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteSequence.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Poly1305.Vec.fst.checked", "Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked", "Hacl.Spec.Poly1305.Field32xN.fst.checked", "Hacl.Impl.Poly1305.Lemmas.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Poly1305.Field32xN.fst" }
[ { "abbrev": true, "full_module": "Lib.ByteSequence", "short_module": "BSeq" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Hacl.Spec.Poly1305.Vec", "short_module": "Vec" }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Poly1305.Field32xN", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntVector", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "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.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305", "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": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Impl.Poly1305.Field32xN.felem w -> b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 (Lib.IntTypes.size w *! 16ul) -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Spec.Poly1305.Field32xN.lanes", "Hacl.Impl.Poly1305.Field32xN.felem", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "Lib.IntTypes.op_Star_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Lib.IntTypes.size", "FStar.UInt32.__uint_to_t", "Hacl.Impl.Poly1305.Field32xN.set_bit128", "Prims.unit", "Hacl.Impl.Poly1305.Field32xN.load_felems_le" ]
[]
false
true
false
false
false
let load_blocks #s f b =
load_felems_le f b; set_bit128 f
false